Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word VBA Constants 2

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
Where are word VBA constants such as wdToggle, wdCell defined?

I want to use them within JavaScript OLE Automation (using word as an ActiveX control), hence don't know what to use to access these constants!)
 
They are located in the Object Browser.
1.Open Word.
2.Open Visual Basic Editor. (Shortcut is Alt+F11)
3.Open Object Browser. (Shortcut is F2)
 
Ok, those constants are listed under 'globals'

but I can't do Word.wdAlignParagraphLeft- not even in VBA. So, how could I access them?
 
If you type wdAlignParagraphLeft in the Search drop down box (next to the binoculars), then do the search (Click on the binoculars), you will see that it's a member of the
WdParagraphAlignment class. You will also see that it's a constant that is equal to 0. The other constants of the WdParagraphAlignment class are also listed. You'll see that wdAlignParagraphCenter = 1, wdAlignParagraphDistribute = 4, etc...

So,
Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
is the sames as
Selection.ParagraphFormat.Alignment = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top