In previous versions of Word, the fancy line drawing styles were available to you. The good news is that you can still access and use fancy lines in Word 2007.
In version 2003, when you draw a line, you could then select the line and click on Format AutoShape and add a little pizzazz to your line by applying one over several available line styles.
For some reason though, that feature seems to be taken away in Word 2007. If you draw a line in this version of Word, you will see a disabled style attribute box.
- Open the Insert tab and in the Illustrations Group, click Shapes | Lines | Basic Line and draw a line in your document.
- Now select your line and right-click and select Autoformat AutoShape. The stye attribute is disabled.
However, a drawing line inserted with VBA can be fully formatted, using the macro below:
Dim oShp As Word.Shape
Set oShp = ActiveDocument.Shapes.AddLine(25, 25, 100, 100)
.Style = msoLineThickBetweenThin
.Weight = 6
Your formatted line is inserted. And now, it can be fully formatted using the Format AutoShape style attribute.
The same behavior is observed when a basic line is inserted using VBA or if a line drawn with version 2003 is copied and pasted into a version 2007 document.
Using VBA, any of the three basic line shapes drawn using the interface in Word 2007 can be converted by selecting the line and running the macro below. The lines can then be fully formatted using the FormatAutoShape style attribute.
Dim oShp As Word.Shape
Dim bHFlip As Boolean
Dim bVFlip As Boolean
Dim oShpNew As Word.Shape
Dim i As Long, j As Long, k As Long, l As Long
Dim lngBAL As Long, lngBAS As Long, lngBAW As Long
Dim lngEAL As Long, lngEAS As Long, lngEAW As Long
Dim lngStyle As Long
Dim pWeight As String
‘Get the cooridates and attributes of the selected line
Set oShp = Selection.ShapeRange(1)
i = oShp.Left
j = oShp.Top
k = oShp.Height
l = oShp.Width
bHFlip = oShp.HorizontalFlip
bVFlip = oShp.VerticalFlip
lngStyle = .Style
pWeight = .Weight
lngBAL = .BeginArrowheadLength
lngBAS = .BeginArrowheadStyle
lngBAW = .BeginArrowheadWidth
lngEAL = .EndArrowheadLength
lngEAS = .EndArrowheadStyle
lngEAW = .EndArrowheadWidth
‘Delete the line
‘Recreate the line as a fully formattable VBA inserted line
Set oShpNew = ActiveDocument.Shapes.AddLine(i, j, i + 72, j)
.Left = i
.Top = j
.Width = l
.Height = k
If .HorizontalFlip <> bHFlip Then .Flip (msoFlipHorizontal)
If .VerticalFlip <> bVFlip Then .Flip (msoFlipVertical)
.Style = lngStyle
.Weight = pWeight
.BeginArrowheadLength = lngBAL
.BeginArrowheadStyle = lngBAS
.BeginArrowheadWidth = lngBAW
.EndArrowheadLength = lngEAL
.EndArrowheadStyle = lngEAS
.EndArrowheadWidth = lngEAW