Changing line spacing within a document

D

Dale Fye

I'm using Access to build a word document using the normal document template.
Generally works well, but the line spacing in the normal document template
is set to Multiple at 1.15.

Since I cannot control the settings of the normal document template on my
users computers, I would like to insert a line in my vba code that would
change the line spacing from whatever is in the normal document template to
single spacing, and set the spacing before and after values to zero.

I am totally unfamiliar with the Word object model, so please be kind.
 
T

That Guy

Try this http://www.thezcorp.com/VBACodeSamples.aspx

There is a note on setting line spacing exactly.

They only show line space exactly but you can also use :

wdLinespace1pt5
wdLineSpaceAtLeast
wdLineSpaceDouble
wdLineSpaceExactly
wdLineSpaceMultiple
wdLineSpaceSingle

I am not sure what each and every one does but if you put this in the
Document_Open sub it will always change the spacing to single when the
document if opened.

ActiveDocument.Range.select
Selection.ParagraphFormat.LineSpacingRule = wdLineSpaceSingle

Good luck.
 
D

Dale Fye

Thanks.

I'm currently working for the US govt, and they have our PCs locked down so
tight, that I cannot even enable macros in Word. When I got home last night,
I recorded a Word macro to get the appropriate settings, and will now insert
them into my Access code.
 

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