Forum Discussion
a_bonsey
May 18, 2022Brass Contributor
text and variables wrapping when placed in new text box
In the snippet of code below the text box that's created wraps to the next line (see image).
The 'item' variable is then followed by the 'perBox' variable and the static text 'in 'Full Boxes' but there is a line break after the 'item' variable.
What causes this and how can I stop it?
TIA
Set TextBox = ActiveDocument.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, Left:=250, Top:=150, Width:=300, Height:=60)
With TextBox
With .TextFrame.TextRange
.Text = strTextBox
.Font.Name = "Arial"
.Font.Size = 10
End With
.Line.Visible = msoFalse
End With
TextBox.TextFrame.TextRange.Text = (item & ": x" & perBox & " in Full Boxes")
a_bonsey I would use a Table.
- Why are you using TextBoxes?
The only reason that I would be using TextBoxes would be if I needed to have one linked to another so that text would flow from one to another over some other object.