|
-
March 23rd, 2006, 10:54 AM
#1
OLE Word automation - Problem with table
Hello,
I want to change the width of a table with ole. What I wanna do is the action from this vba-makro:
Selection.Columns.PreferredWidthType = wdPreferredWidthPercent
Selection.Columns.PreferredWidth = 60
What I have is this:
Table table = ((Tables)m_Doc.GetTables()).Add(range, 1, 2);
Columns cols = table.GetColumns();
Column col = cols.GetFirst()
col.SetProperty(???, 2);
col.SetWidth(60, 0);
What is missing is the value of ???.
Where can I find documentation of DISPID?
Thanks
Michael
-
March 23rd, 2006, 02:33 PM
#2
Re: OLE Word automation - Problem with table
When I look at the column class of the type library with OleView
(VS 6.0) or the Object inspector in VS.Net I find
Code:
[id(0x0000006a), propput, helpcontext(0x094b006a)]
void PreferredWidthType([in] WdPreferredWidthType rhs);
So I would guess the property number is 6a in hex or 106 in decimal.
***************************
What version of Word are you using? What version of VC++?
When I do this I would use
col.SetPreferredWidthType(2);
col.SetWidth(60,0);
because SetProperty isn't even a member of my Column class.
Last edited by Tom Frohman; March 23rd, 2006 at 02:49 PM.
Verere testudinem! (Fear the turtle)
Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein
Robots are trying to steal my luggage.
-
March 24th, 2006, 02:50 AM
#3
Re: OLE Word automation - Problem with table
Hi,
I user VC 6.0 and Word XP. And I can't finde the SetPreferredWidthType function.
Michael
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|