c# - Generate a Word Document from StringBuilder -


i have make word integration part of exam project. problem rather new microsoft word integration in c#. have assemblies need, , got set-up ready write code pretty much. document generated scratch.

but starring @ blinking cursor, not knowing how start.

i have take stringbuilder (which should hold stuff escape characters new lines, perhaps italic bold, etc kind of formatting well.) stringbuilder given part of application written friend.

would suggest delivered in form stringbuilder object?

and should start this? it's bit overwhelming.

thanks

try

you need add microsoft.office.interop.word reference

word._application oword; word._document odoc; object omissing = type.missing; oword = new word.application(); oword.visible = true;  //add blank sheet word app odoc = oword.documents.add(ref omissing, ref omissing, ref omissing, ref omissing);   oword.selection.typetext("write text here"); //formatting text oword.selection.font.size = 8; oword.selection.font.name = "zurich bt"; oword.selection.font.italic = 1 oword.selection.font.bold = 1  odoc.content.application.activewindow.activepane.view.seekview = //havent tested                                                                //header , footer part word.wdseekview.wdseekcurrentpagefooter; odoc.content.application.selection.typetext(“martens”); 

i guess might looking for


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -