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.
 
Top