VBScript Alignment

S

SRowe

I am writing a VBScript to report on some AD stuff. I got the code working
great but I am unable to center the text. Here is what I pulled from a macro:

Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

It does not work. I'm guessing because VBScript does not have a value for
wdAlignParagraphCenter. Anyone know where I can find the correct value or
pull them from Word?

Scott
 
J

Jay Freedman

I am writing a VBScript to report on some AD stuff. I got the code working
great but I am unable to center the text. Here is what I pulled from a macro:

Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

It does not work. I'm guessing because VBScript does not have a value for
wdAlignParagraphCenter. Anyone know where I can find the correct value or
pull them from Word?

Scott


Hi Scott,

The value of wdAlignParagraphCenter is 1.

In general, open the VBA editor in Word and press F2 to display the
Object Browser. Type in the name of a constant and press Enter. The
value will be displayed at the bottom of the window.
 

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