Patrick
Tue Apr 17 11:11:39 CDT 2007
This a sample of the code I am using, where "Text Box 217" represents a
TextBox I drew on the document and "TextBox1" is the TextBox on the
UserForm. This document is used by a small group (2 to 3 people) to conduct
an eligibility interview over the phone. They wanted the ability to do the
interview sections randomly based on the conversation with the applicant. I
created UserForms for the various sections and on each UserForm there are
buttons which allow them to go to different parts of the interview. As the
exit (terminate) each UserForm the data is placed on the form. If the return
to any particular section to add or update data they can select the button
for that section, and when the UserForm opens it is populated with the data
currently on the form. It all works great here, but as I mentioned before,
when I took it to work, Word renumbered the TextBoxes on the document (not
the UserForms).
Private Sub UserForm_Terminate()
'Text Input''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Last Name
ActiveDocument.Shapes("Text Box 217").TextFrame.TextRange.Text =
TextBox1.Text
'First Name
ActiveDocument.Shapes("Text Box 218").TextFrame.TextRange.Text =
TextBox2.Text
"Jean-Guy Marcil" <DontEvenTry@NoSpam> wrote in message
news:u$8Z9iQgHHA.4868@TK2MSFTNGP06.phx.gbl...
> Patrick C. Simonds was telling us:
> Patrick C. Simonds nous racontait que :
>
>> When I do that, Properties is not an option. Reading between the
>> lines of all this great help I have been receiving, I think I have
>> been creating my TextBoxes the wrong way. I have been using Insert
>> then TextBox and then drawing my TextBox. I think what I should be
>> doing is creating them by selecting the Developer bar.
>>
>
>
> What Word version?
>
> Because you wrote about numbered textboxes, I thought you were writing
> about ActiveX controls that are inserted with the "Controls Toolbox"
> toolbar.
>
> Now, finally, I understand what you are doing.
>
> How were the textboxes numbered (I.e, how did you know which textbox was
> represented by which number?) Are you referring the index number in the
> shape collection?
> Can I see the some of the code you used to fill the textboxes?
>
> And again, in case there is an easier way to achieve your goal, what is
> the context for the document usage? Who uses it and to what purpose?
> Is it protected for forms?
>
> --
>
> Salut!
> _______________________________________
> Jean-Guy Marcil - Word MVP
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site:
http://www.word.mvps.org
>