|
-
Apr 18th, 2006, 06:50 AM
#1
Thread Starter
Lively Member
Control Array In Word VBA
I have created a control array in visual basic so that when you type text into one textbox it gets copied into another texbox. This works fine, but i was trying to emulate this with VBA in a word document. I know you cannot use control arrays in VBA, but I cannot find on the internet many solutions (that I can get working).
Any ides would be helpful cheers.
caz
-
Apr 18th, 2006, 09:06 AM
#2
Re: Control Array In Word VBA
Control Arrays are not available in VBA.
You could use the _Change event of the first textbox to populate the value in the second.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Apr 18th, 2006, 11:34 AM
#3
Thread Starter
Lively Member
Re: Control Array In Word VBA
yeh i have tried using the change event, but have not found out how to make the text copied into the second textbox.
Thanks for your help.
caz
-
Apr 18th, 2006, 02:29 PM
#4
Thread Starter
Lively Member
Re: Control Array In Word VBA
Thanks DKenny, I have found and implemented a simple solution just using the code.
Text1.Text = Text2.Text
And this worked excellently but do you think there is anyway i could type into the document and it go into the textbox i dont really know the appropiate code e.g.
Document.Text = Text2.Text
Thanks again for your help.
caz
-
Apr 18th, 2006, 03:03 PM
#5
Re: Control Array In Word VBA
Now I'm confused. Do you want
A/ the text of the document put into a text box (as per "anyway i could type into the document and it go into the textbox")
or
B/ The text from a text box put into a document (as per "Document.Text = Text2.Text")
If A/ is the requirment, do you want all of the text from the doc or just a section? What do you do when the document is too long to all fit into a textbox?
So I gues my question is
What are you really trying to acomplish here?
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Apr 18th, 2006, 03:16 PM
#6
Thread Starter
Lively Member
Re: Control Array In Word VBA
Well I am trying to create a simple language translation macro, my program so far consists of using the autocorrect feature to translate text entered into the document. I wanted a feature of the macro that the user could see in a text box what they typed before the autocorrect changed the word. I was going to use two textboxes but i was wondering if i could type into the document and the unchanged text gets sent to the text box, because the autocorrect feature does not work in a textbox.
Thanks for your help, So its option A.
caz
-
Apr 18th, 2006, 03:19 PM
#7
Re: Control Array In Word VBA
Have you considered turning Autocorrect off?
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Apr 18th, 2006, 03:22 PM
#8
Thread Starter
Lively Member
Re: Control Array In Word VBA
but i want autocorrect on so it changes the words.
-
Apr 18th, 2006, 07:43 PM
#9
Thread Starter
Lively Member
Re: Control Array In Word VBA
The key feature of using a textbox was that in a textbox, autocorrect doesnt work so if the text got copied to the textbox it would be in its original format before being changed with autocorrect.
Thanks for the help.
caz
-
Apr 19th, 2006, 07:07 AM
#10
Thread Starter
Lively Member
Re: Control Array In Word VBA
Just realised this cannot be done. so i have gone another route of using 2 textboxes, but i need to allow 1 textbox to have autocorrect on, anyone know how to do this?
caz
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
|