Adding border to a TextFrame using VBA

P

PJTewkesbury

Hi,

I am using MS Publisher2003 and I want to use a VBA macro to create a
textbox with borders on the top and bottom of the textbox but NOT the sides.

I have the following VBA code to create a textbox with a border all the way
round, but I can not figure out how to only have the border on just the top
and bottom,

' Create TextBox
Dim s As Shape
Set s = ActiveDocument.Pages(1).Shapes.AddTextbox
(pbTextOrientationHorizontal, doc.LayoutGuides.MarginLeft, pos,
doc.Pages(1).Width - doc.LayoutGuides.MarginLeft -
doc.LayoutGuides.MarginRight, "1.5cm")
s.Name = "ArticalTitle"
' Set font & text properties
s.TextFrame.TextRange.Font.Name = "Times New Roman"
s.TextFrame.TextRange.Font.Size = "18pt"
s.TextFrame.TextRange.Font.Bold = msoTrue
s.TextFrame.TextRange.Text = "Title"
s.TextFrame.AutoFitText = pbTextAutoFitShrinkOnOverflow
' Define Border Properties
s.Line.Weight = "1pt"
s.Line.DashStyle = msoLineSolid
s.Line.ForeColor.RGB = RGB(0, 0, 0)
s.Line.InsetPen = msoFalse
s.Line.Style = msoLineThickBetweenThin

Any help would be appreciated

Peter Tewkesbury
 
M

Mary Sauer

I have no clue about your query, but why not just select the text box, click lines,
click more lines and select the top and bottom borders?
 
P

PJTewkesbury

I am working on a program which will insert new content from the web into a
publication automaticlly without the user needing to change every single text
box that I insert.
 

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