PDA

View Full Version : Solved: Listing Enums



Marcster
12-07-2005, 03:54 AM
How do you write the members of an Enum
to the Debug.Print window?. :dunno

For example in Word:
List all contents of wdPaperSize
so the Debug.Print window displays:

wdPaper10x14 = 0
wdPaper11x17 = 1
wdPaperA3 = 6
etc...
Thanks,

Marcster.

TonyJollans
12-07-2005, 06:12 AM
You can't. Well, that's not strictly true, you can but it's not a normal feature.

You can examine the Word object model with the TypeLib Information Library (TLBINF32.DLL) - part of VB (or .NET) runtime, I think.

Having seen your responses in other threads, I suspect that telling you what to look for is probably enough for you but, if not, I ought to be able to root out some code if I dig deeply enough.

Marcster
12-07-2005, 06:41 AM
Hi Tony :hi: ,
Thought so. :(
I did try a For Each but as i'm sure you know:
For Each may only iterate over a collection object or an array
I just thought that if it was possible with VBA
that it would be good macro to have.
So instead of manually typing the constants out I
could just use some code.

Ah, Killians just posted a great little tip:
http://www.vbaexpress.com/forum/showthread.php?p=52089#post52089

Marcster.

fumei
12-08-2005, 12:58 AM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd11/html/wohowConstants_HV01049731.asp

has a web based listing of Word (2003) constants.

I have a file (somewhere) of Word 2002 constants...somewhere...bookmarked for easy retrieval....somewhere.