How to Change Font Styles in Word Document with VB.net

A

Art

Hello,

I'm writing a VB app under Visual Studio 2005 that is to generate a word
document using MS Office Word 2007.

As I generate new lines of text, it seems to be using the 'Normal' fonts so
that each time I execute a ".Range.InsertParagraphAfter()" statement, it
looks like it is double spacing each line. I'd like to change the font style
to 'No Spacing' as that seems to make each line closer to one another. This
may not be the best way to do it but it's the only way I can see to make it
work when I mess around with actually changing the fonts with MS Word itself.
So I'd could use anything else that might work.

Anyway, thanks in advance.
 
P

pGuernseyPlayer

Art,

See if this works for you:

' Set the document's spacing to single
Dim originalLineSpacing = patientDoc.Paragraphs.LineSpacing
' = 13.8(this was too much).
patientDoc.Paragraphs.LineSpacing = 10

Paul
 

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