string to Word with seting fonts and size

K

Kim

Hi all

I have in my app. a view of pages and generate UniCode UTF8 then I write to
doc file, but want to make the doc file in word. I know how to write some
tekst in a word document generated by C#. But how to set fonts and size,
because if I just convert to word size is not rigth and a better font.

Regards
Kim S
 
N

Nicholas Paldino [.NET/C# MVP]

Kim,

What version of Word are you targeting? If you are targeting word
before 2003, you will have to automate Word (google it to see examples) and
construct the document that way.

I believe there is a vendor that offers a component to help generate
Word documents outside of Word, but I can't remember the name right now.

If you are targeting Word 2003 and above, you should be able to create
the document in XML.

If you are targeting Word 2007, you should be able to create a docx file
by creating XML files and using the classes in the System.IO.Packaging
namespace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top