|
-
Jun 17th, 2005, 06:34 AM
#1
How do I dynamically create textboxes in a custom word form - Resolved
I have a customer form fired up from a word macro and I want to create a number of textboxes on it. I have to create them dynamically as I don't know how many at design time.
My own investigations and a trawl round the forums pointed me at 2 possible ways of achieving it but neither's working for me:-
1 txtBox = Me.Controls.Add(progid, "txtField", True) The problem here is I can't work out the progid for a text box - various sources quote VB.TextBox but word doesn't seem to recognise VB - maybe I just need to add a reference but I can't work out which.
2 Create an control array with a single element and then 'load' it to create new instances of the control in the array, something like: Load txtField(1) The problem with this one is that word doesn't seem to support control arrays - the text box has no index property and if I try to add an identically named control it barfs and tells me the name's ambiguous, no option to create an array.
So can anyone tell me how to:-
get the progID in word for a text box
or
create a control array in word
or
do something else entirely?
Thanks in advance
Last edited by FunkyDexter; Jun 22nd, 2005 at 04:01 AM.
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
|