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.
> Patrick C. Simonds was telling us:
> Patrick C. Simonds nous racontait que :
[quoted text clipped - 5 lines]
>
> Right click on it and select "Properties"
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?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Patrick C. Simonds - 17 Apr 2007 17:11 GMT
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
> Patrick C. Simonds was telling us:
> Patrick C. Simonds nous racontait que :
[quoted text clipped - 21 lines]
> the context for the document usage? Who uses it and to what purpose?
> Is it protected for forms?
Jean-Guy Marcil - 17 Apr 2007 18:09 GMT
Patrick C. Simonds was telling us:
Patrick C. Simonds nous racontait que :
> 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
[quoted text clipped - 23 lines]
> ActiveDocument.Shapes("Text Box 218").TextFrame.TextRange.Text =
> TextBox2.Text
If you want to stick to your textbox approach, you can name those textboxes.
Insert a textbox any way you want to, then select it and run the following
code:
Selection.ShapeRange(1).Name = "MyTextboxName"
and then use "MyTextboxName" elsewhere in your code.
If the user can be trusted not to upset the document layout, or if it is
protected for forms, you can use DOCVARIABLE fields instead of textboxes.
Create the document variables like this:
ActiveDocument.Variables("FirstDocVar").Value = TextBox1.Text
and in the document, place a field:
{DOCVARIABLE FirstDocVar}
This way you do not have to interact directly with the document other than
doing a
ActiveDocument.Fields.Update
And loading the values is also easy:
TextBox1.Text = ActiveDocument.Variables("FirstDocVar").Value

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org