Multi-line Text from Userforms

User avatar
BerylM
NewLounger
Posts: 15
Joined: 28 Mar 2010, 20:45
Location: Morden, Surrey (UK)

Multi-line Text from Userforms

Post by BerylM »

I know I should remember this but I'm so rusty it isn't true and I've *got* to get this done tonight, so would someone please remind me - how do you get the contents of a multi-line text box in a userform to appear in the document with returns and not run together into one line?

The text in question is the address on a letter, so it has to remain on separate lines, but a straight find-replace of a keyword in the document with the textbox contents comes in with a couple of odd characters (empty boxes) instead of the return in each case and the text run together onto one line.

If somebody would please put me out of my misery I would be exceedingly grateful!

Rgards
Beryl M
BerylM

User avatar
HansV
Administrator
Posts: 78397
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Multi-line Text from Userforms

Post by HansV »

If you use Selection.TypeText Me.TextBox1 or Selection.InsertAfter Me.TextBox1, it should work OK.
Best wishes,
Hans

User avatar
BerylM
NewLounger
Posts: 15
Joined: 28 Mar 2010, 20:45
Location: Morden, Surrey (UK)

Re: Multi-line Text from Userforms

Post by BerylM »

Thank you, Hans, you've saved my life! (LOL - nothing much changes, does it?!)

Beryl M
BerylM