Click here to Skip to main content
14,149,668 members
Rate this:
 
Please Sign up or sign in to 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:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.wdunits(v=office.14).aspx[^]

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.
Posted
Comments
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.
—SA

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
   
Comments
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190518.1 | Last Updated 8 Jul 2013
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100