Sol Apache was telling us:
Sol Apache nous racontait que :
I am creating a letterhead template with a userform which has some of
its fields containing default data. I insert the default text in the
³Text² field of the Properties list.
One of the fields has several lines of text, and the field is set to
Multiline = True but each time I try to insert the 2nd line of text it
overwrites the one I have already typed in.
Is there any way of having multiple line default text?
Yes.
How are you inserting this second line?
Three ways:
1) While in the VBA editor, select your textbox. Wait a few seconds and
click on it again (Just make sure you do not do an actual double-click
because this will take you to the code pane with a Click event sub), you
should be able to type the default text directly in the text box instead of
going through the properties pane. Now, as you type, if, as you say,
MultiLine is set to True, the text will automatically wrap to the next line
when you get to the end. You can force a new line by hitting CTRL-Enter
2) Just type the text in the Text property in the properties pane, if it is
too long, it will automatically wrap.
3) Use something like this in the Initialize event:
Private Sub UserForm_Initialize()
Me.TextBox1.Text = "This is the default text that should be" & vbCrLf &
"on many lines becasue it is too long."
End Sub
Here I used a vbCrLf to force a nee line, but you could remove " & vbCrLf &
" and replace it by a single space and the text would automatically wrap.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org