Multiline Field Problems 
Author Message
 Multiline Field Problems

Hello,

I have a Word2002 Template that uses as  UserForm that has several
textboxes.  One TextBox is multiline.

My problem is when this textbox field is inserted into the FormField on the
document I just get enter key symbols (Test [][]Test[][]Test[][] etc.) in a
single line not on a new line.  How can I remove the enter key symbols and
actually have the multilines show?

Here is the current code I am using (Memo) is the multiline field.

' Sets variables for each text box on form
    vtxtTo = UserForm2.txtTo.Text
    vtxtFrom = UserForm2.txtFrom.Text
    vtxtCC = UserForm2.txtCC.Text
    vtxtRe = UserForm2.txtRe.Text
    vtxtMemo = UserForm2.txtMemo.Text

' Goes to each field on form and sets results equal to variables
    ActiveDocument.FormFields("bkTo").Result = vtxtTo
    ActiveDocument.FormFields("bkFrom").Result = vtxtFrom
    ActiveDocument.FormFields("bkCC").Result = vtxtCC
    ActiveDocument.FormFields("bkRe").Result = vtxtRe
    ActiveDocument.FormFields("bkMemo").Result = vtxtMemo

Please Help



Wed, 20 Jul 2005 07:47:39 GMT  
 Multiline Field Problems
Hi Bryan,

I don't get the same behaviour that you report.

If the data entered into the control is allowed to wordwrap of its own
accord, it will all be treated as an unbroken string of text when it is
inserted into the document with wordwrapping occuring in the document as it
would normally.  If in the control, Shift+Enter is used to force a line
break, that will cause each "line" of text in the control to be treated as a
separate paragraph when the text is entered into the document.

Similarly, if the enter key behaviour is set to true, the Enter key will
force a new line in the control and that line will be treated as a separate
paragraph in the document.

If you want the text to wordwrap in the document in the exactly the same way
as you force linebreaks in the control, then, instead of the using the
.Result property of a formfield, you must insert the text into the range of
a bookmark by using code such as

ActiveDocument.Bookmarks("bkMemo1").Range.InsertBefore txtMemo

There is no need to go through the routine of defining and setting
variables.  You can insert the contents of the control directly.  With .text
being the default property of a textbox control, it is not necessary to use
txtMemo.text.

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> Hello,

> I have a Word2002 Template that uses as  UserForm that has several
> textboxes.  One TextBox is multiline.

> My problem is when this textbox field is inserted into the FormField on
the
> document I just get enter key symbols (Test [][]Test[][]Test[][] etc.) in
a
> single line not on a new line.  How can I remove the enter key symbols and
> actually have the multilines show?

> Here is the current code I am using (Memo) is the multiline field.

> ' Sets variables for each text box on form
>     vtxtTo = UserForm2.txtTo.Text
>     vtxtFrom = UserForm2.txtFrom.Text
>     vtxtCC = UserForm2.txtCC.Text
>     vtxtRe = UserForm2.txtRe.Text
>     vtxtMemo = UserForm2.txtMemo.Text

> ' Goes to each field on form and sets results equal to variables
>     ActiveDocument.FormFields("bkTo").Result = vtxtTo
>     ActiveDocument.FormFields("bkFrom").Result = vtxtFrom
>     ActiveDocument.FormFields("bkCC").Result = vtxtCC
>     ActiveDocument.FormFields("bkRe").Result = vtxtRe
>     ActiveDocument.FormFields("bkMemo").Result = vtxtMemo

> Please Help



Wed, 20 Jul 2005 17:08:50 GMT  
 Multiline Field Problems
Help me out please!! I have the same problem of not being
able to have multiple lines of text in a Text Area form
box when making a webpage! I am a beginner and have no
idea what you are talking about! I have tried
plain "Enter" and tried using "Shift+Enter"
Casey

Quote:
>-----Original Message-----
>Hi Bryan,

>I don't get the same behaviour that you report.

>If the data entered into the control is allowed to
wordwrap of its own
>accord, it will all be treated as an unbroken string of
text when it is
>inserted into the document with wordwrapping occuring in
the document as it
>would normally.  If in the control, Shift+Enter is used
to force a line
>break, that will cause each "line" of text in the control
to be treated as a
>separate paragraph when the text is entered into the
document.

>Similarly, if the enter key behaviour is set to true, the
Enter key will
>force a new line in the control and that line will be

treated as a separate
Quote:
>paragraph in the document.

>If you want the text to wordwrap in the document in the

exactly the same way
Quote:
>as you force linebreaks in the control, then, instead of
the using the
>..Result property of a formfield, you must insert the

text into the range of
Quote:
>a bookmark by using code such as

>ActiveDocument.Bookmarks("bkMemo1").Range.InsertBefore
txtMemo

>There is no need to go through the routine of defining
and setting
>variables.  You can insert the contents of the control

directly.  With .text
Quote:
>being the default property of a textbox control, it is

not necessary to use
Quote:
>txtMemo.text.

>Please post any response to the newsgroups for the

benefit of others who may

- Show quoted text -

Quote:
>also be following the thread.

>Hope this helps,
>Doug Robbins - Word MVP



>> Hello,

>> I have a Word2002 Template that uses as  UserForm that
has several
>> textboxes.  One TextBox is multiline.

>> My problem is when this textbox field is inserted into
the FormField on
>the
>> document I just get enter key symbols (Test [][]Test[][]
Test[][] etc.) in
>a
>> single line not on a new line.  How can I remove the

enter key symbols and

- Show quoted text -

Quote:
>> actually have the multilines show?

>> Here is the current code I am using (Memo) is the
multiline field.

>> ' Sets variables for each text box on form
>>     vtxtTo = UserForm2.txtTo.Text
>>     vtxtFrom = UserForm2.txtFrom.Text
>>     vtxtCC = UserForm2.txtCC.Text
>>     vtxtRe = UserForm2.txtRe.Text
>>     vtxtMemo = UserForm2.txtMemo.Text

>> ' Goes to each field on form and sets results equal to
variables
>>     ActiveDocument.FormFields("bkTo").Result = vtxtTo
>>     ActiveDocument.FormFields("bkFrom").Result =
vtxtFrom
>>     ActiveDocument.FormFields("bkCC").Result = vtxtCC
>>     ActiveDocument.FormFields("bkRe").Result = vtxtRe
>>     ActiveDocument.FormFields("bkMemo").Result =
vtxtMemo

>> Please Help

>.



Fri, 19 Aug 2005 01:56:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Position of multiline form fields

2. Printer.print with memo-field and multiline

3. MultiLine fields?

4. formula field contains multiline text

5. Multiline Fields in CR

6. Database grid with Multiline text fields

7. multiline textbox problem

8. Printing a multiline text box problem

9. HELP! Multiline text box problem

10. Multiline txtbox - txt.SetText problem

11. vb5 multiline problems

12. Multiline textbox problem

 

 
Powered by phpBB® Forum Software