K
Kristi
I have a userform with a text box in which multiple lines can be entered. It
is a letter template and the text box is to indicate "copies to" at the
bottom of the letter. If there is more than one person to be copied
(separated by Enter key), I want those on lines 2+ to be indented in my
letter.
Below is my code. It works fine if there are two or less people being
copied. If there are three or more, it puts all the tabs on the last line.
It is as if it is skipping the "Selection.MoveUp Unit:=wdParagraph, Count:=1"
line in the loop statement. The value of the variable NumCopies is assigned
previously to equal the linecount of the text box. Why is it putting all the
tabs on the last line?
Using Word 2002. Thank you.
If NumCopies > 1 Then
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=vbTab
NumCopies = NumCopies - 2
Do Until NumCopies = 0
Selection.MoveUp Unit:=wdParagraph, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=vbTab
NumCopies = NumCopies - 1
Loop
End If
is a letter template and the text box is to indicate "copies to" at the
bottom of the letter. If there is more than one person to be copied
(separated by Enter key), I want those on lines 2+ to be indented in my
letter.
Below is my code. It works fine if there are two or less people being
copied. If there are three or more, it puts all the tabs on the last line.
It is as if it is skipping the "Selection.MoveUp Unit:=wdParagraph, Count:=1"
line in the loop statement. The value of the variable NumCopies is assigned
previously to equal the linecount of the text box. Why is it putting all the
tabs on the last line?
Using Word 2002. Thank you.
If NumCopies > 1 Then
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=vbTab
NumCopies = NumCopies - 2
Do Until NumCopies = 0
Selection.MoveUp Unit:=wdParagraph, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=vbTab
NumCopies = NumCopies - 1
Loop
End If