I have some questions about what you've done and what you're seeing,
because your description doesn't match my experience.
- Is the textbox in the userform set to MultiLine = True and
EnterKeyBehavior = True?
- Is the code in your userform something like this?
ActiveDocument.FormFields("Text1").Result = TextBox1.Text
- Do you really see a single long line in the form field where you
expect to see several lines?
When I set up a userform as I indicated in the first two items, the
form field shows multiple lines, but each line starts with a square.
That's because the return in the userform's textbox consists of two
characters, Chr(13) & Chr(10), while a return in the form field is
only the Chr(13). The Chr(10) appears as the box. The solution for
that is to write the line of code as
ActiveDocument.FormFields("Text1").Result = _
Replace(TextBox1.Text, Chr(10), "")
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>Hi,
>
[quoted text clipped - 17 lines]
>Thanks,
>Jille
jille - 06 Mar 2007 13:33 GMT
Hi Jay,
Yes to all questions and I did get the squares instead of hard carriage
return but I didn't know what it meant.
You identified the exact problem...
Thanks for your help,
Jille
> I have some questions about what you've done and what you're seeing,
> because your description doesn't match my experience.
[quoted text clipped - 47 lines]
> >Thanks,
> >Jille
jille - 06 Mar 2007 13:59 GMT
I should clarify....
I am getting two small boxes where a single hard carriage should appear.
When I try the code you suggest I get one box instead of two. So I replaced
both the Chr(10) & 13 and determined that they were both being represented as
a small box. Now how do I add a hard carriage in?
FYI, I'm using Word 2000!
> I have some questions about what you've done and what you're seeing,
> because your description doesn't match my experience.
[quoted text clipped - 47 lines]
> >Thanks,
> >Jille
Jay Freedman - 06 Mar 2007 15:03 GMT
That's just plain weird. The Chr(13) should become a paragraph mark inside
the text formfield.
You could try this in your code:
Dim temp As String
temp = TextBox1.Text
temp = Replace(temp, Chr(10), "")
temp = Replace(temp, Chr(13), vbCr)
ActiveDocument.FormFields("Text1").Result = temp
The built-in value vbCr is really just a constant that represents a carriage
return (paragraph mark), but maybe forcing the replacement will make Word
happy. If that doesn't work, I'm out of tricks for now.

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
> I should clarify....
>
[quoted text clipped - 60 lines]
>>> Thanks,
>>> Jille
jille - 06 Mar 2007 15:33 GMT
Hi Jay,
The vbcr didn't work. I ended up pulling the boxes out using your replace
strings but replaced one with a tilde so that I could do a search & replace
once the text was in the form. It's awkward but I'm happy its solved!.
Thanks for all your help.
Jill
> That's just plain weird. The Chr(13) should become a paragraph mark inside
> the text formfield.
[quoted text clipped - 75 lines]
> >>> Thanks,
> >>> Jille