WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Constants

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Value of an OLE Constant

 Keywords:  Retrieve COM OLE constants

Question:

What is the best way to get the values of various OLE/Com constants? For example, I need to track down the value of the wdHeaderFooterPrimary constant in Word.

Answer:

There are several places to look for the values. For one you can use the WB ObjectConstantsGet function to get a "constants object" that has each constant associated with a COM server as a property. For example
objWord = ObjectCreate("Word.Application")

; Get the constants ( takes a few seconds)
objWordConts = ObjectConstantsGet(objWord)

Message("The value of wdHeaderFooterPrimary", objWordConts.wdHeaderFooterPrimary)

objWordConts = 0
objWord      = 0


You can also check the product documentation for the OLE/COM Object.

Microsofts Object Constants can be located on their web site at http://msdn.microsoft.com/library/en-us/vbawd11/html/wohowConstants_HV01049731.asp


If the application you are attempting to automate contains an object browser you can generally use the object browser to track down the values of the various constants.


Article ID:   W17120
File Created: 2007:07:03:14:28:22
Last Updated: 2007:07:03:14:28:22