I would like to copy textbox to other location.
Dim bonmb3a As Shape, bonmb3b As Shape
Set bonmb3a = bow.Shapes.AddTextbox(msoTextOrientationHorizontal, 14, 333, 47, 21)
With bonmb3a
.Name = "Building Overview Box 3A"
With .line
.ForeColor.RGB = RGB(255, 192, 0)
.Weight = 3
End With
With .TextFrame2
.TextRange.Characters.Text = "3"
.TextRange.ParagraphFormat.Alignment = msoAlignCenter
With .TextRange.Characters.Font
.Bold = msoTrue
.size = 12
End With
End With
.Copy
End With
Set bonmb3b = bonmb3a.Paste(550, 140, 47, 21)
but with the following code I can’t see pasted object. No error shown.
How could I copy the textbox to the specified location?
>Solution :
Just use Paste without parameters.
After pasting, the new textbox is the last shape on the sheet. Then you can modify the properties you need, eg position (top + left) or name or caption.
bow.Paste
Set bonmb3b = bow.Shapes(bow.Shapes.Count)
With bonmb3b
.Left = 550
.Top = 140
.Name = "Building Overview Box 3B"
.TextFrame2.TextRange.Characters.Text = "4"
End With