Click here to Skip to main content
14,980,809 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone!

I would like to start by saying thanks to everyone who takes some time to view this thread and try to help.

I have a table that needs to be populated with data.I have asked a question about it here:
How to insert text into tables in MS WORD ?[^]

However,I need to pass variant with cell width to AutoWrap function instead of character width.
My question is:
How to get integer values of these enumeration constants:[^]

I just need to pass it as a variant to AutoWrap.
I work in MS Visual Studio Express 2008, on Windows XP, in C++, using pure WIN32 API.
Thank you all.
Richard MacCutchan 8-Jul-13 12:34pm
They are probably in the order shown in the documentation page, although I'm not certain whether they start at zero or 1.
First of all, please stop posting fake answers.

1 solution

What, like these ones below? - If so, just keep reading that page - they're in one of the comments.

But if you want to look up arbitrary constants and are sick of using google, just use the built-in tool that MS provides.
I.e When you're got the script editor open, Goto View->Object Browser (F2) - you can see the member variables of objects and the values of enumerations.

wdCell = 12
wdCharacter = 1
wdCharacterFormatting = 13
wdColumn = 9
wdItem = 16
wdLine = 5
wdParagraph = 4
wdParagraphFormatting = 14
wdRow = 10
wdScreen = 7
wdSection = 8
wdSentence = 3
wdStory = 6
wdTable = 15
wdWindow = 11
wdWord = 2
MyOldAccount 9-Jul-13 3:34am
I have tested them and seem that they work!
Thank you.
enhzflep 9-Jul-13 5:58am
You're welcome. The 'object browser' is perfect when doing COM stuff with MS office, so many functions, enums and variables to have to keep track of explicitly. It makes seeing what they are so very easy. At least VBA was nicer to use for this kind of stuff. :grin:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900