Borders and Text Boxes

N

Nick Marinelli

I've created a text box using VBA with the following code:

Set myDocument = ActiveDocument
Set aRange = ActiveDocument.Bookmarks("BPP").Range

With myDocument.Shapes.AddShape(msoShapeRectangle, _
0, 0, 470, 75, aRange).TextFrame
.TextRange.Font.Name = "Arial"
.TextRange.Font.Bold = wdToggle
.TextRange.Text = " (a) "
.TextRange.Font.Bold = wdToggle
.TextRange.InsertAfter ("Here is some more text that I have placed into
the frame.")
End With

This draws the text box, places it where I want it, and puts text into it.
However, I want to eliminate the border it creates. Is the border on the
TextFrame or the TextBox? How do I remove the border?
 
N

Nick Hebb

Try,

Public Sub AddTextBox()

Dim aRange As Range
Dim tb As Shape

Set aRange = ActiveDocument.Bookmarks("BPP").Range

Set tb =
ActiveDocument.Shapes.AddTextBox(msoTextOrientationHorizontal, 0, 0,
470, 75, aRange)

With tb.TextFrame.TextRange
.Font.Name = "Arial"
.Font.Bold = wdToggle
.Text = " (a) "
.Font.Bold = wdToggle
.InsertAfter ("Here is some more text that I have placed into
the frame.")
End With

tb.Line.Visible = msoFalse

Set tb = Nothing
Set aRange = Nothing

End Sub


HTH,

Nick Hebb
BreezeTree Software
http://www.breezetree.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top