W
Workgroups
I'm trying to use the following method to insert a textbox into a document
and format it as I go, but I'm up against some sort of vba
compiler/syntactical problem I don't understand yet:
With ActiveDocument.Shapes.AddTextBox([orientation, position size etc])
...[various textbox class members here, e.g....]
.TextAlign = fmTextAlignCenter
.BorderStyle = fmBorderStyleNone
[etc]
End Width
But Option Explicit doesn't like that, presumeably becuase 'AddTextBox' is
returning a Shape, not a Textbox.
My first instict is to want to do something like...
With Ctype(ActiveDocument.Shapes.AddTextBox(...), TextBox)
...[compiler-friendly textbox member references]
End With
But that's vb.net, not vba. How do I get vba to let me play with what
..AddTextBox is returning as if it were a textbox while keeping Option
Explicit happy? I don't want to cheat and turn it off. Is there a
Ctype-like keyword, a different add-a-textbox method I'm not aware of?
and format it as I go, but I'm up against some sort of vba
compiler/syntactical problem I don't understand yet:
With ActiveDocument.Shapes.AddTextBox([orientation, position size etc])
...[various textbox class members here, e.g....]
.TextAlign = fmTextAlignCenter
.BorderStyle = fmBorderStyleNone
[etc]
End Width
But Option Explicit doesn't like that, presumeably becuase 'AddTextBox' is
returning a Shape, not a Textbox.
My first instict is to want to do something like...
With Ctype(ActiveDocument.Shapes.AddTextBox(...), TextBox)
...[compiler-friendly textbox member references]
End With
But that's vb.net, not vba. How do I get vba to let me play with what
..AddTextBox is returning as if it were a textbox while keeping Option
Explicit happy? I don't want to cheat and turn it off. Is there a
Ctype-like keyword, a different add-a-textbox method I'm not aware of?