L
LEU
I have the following macros that I can’t get to work. It draws my line
correctly but I can’t get it to put the text from my variable in front of it.
What am I doing wrong?
Sub test1()
Dim myText As String
myText = "PV"
Call test4
End Sub
Sub test2()
Dim myText As String
myText = "IV"
Call test4
End Sub
Sub test3()
Dim myText As String
myText = "SI"
Call test4
End Sub
Sub test4()
Dim myText
With Selection.ParagraphFormat
.RightIndent = InchesToPoints(0.48)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
Selection.Font.Underline = False
Selection.TypeText Text:=myText
i = Selection.Information(wdVerticalPositionRelativeToPage)
Set oFFline = ActiveDocument.Shapes.AddLine(554, i + 12, 524, i + 12)
With oFFline.Line
.Weight = 0.75
End With
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub
correctly but I can’t get it to put the text from my variable in front of it.
What am I doing wrong?
Sub test1()
Dim myText As String
myText = "PV"
Call test4
End Sub
Sub test2()
Dim myText As String
myText = "IV"
Call test4
End Sub
Sub test3()
Dim myText As String
myText = "SI"
Call test4
End Sub
Sub test4()
Dim myText
With Selection.ParagraphFormat
.RightIndent = InchesToPoints(0.48)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
End With
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
Selection.Font.Underline = False
Selection.TypeText Text:=myText
i = Selection.Information(wdVerticalPositionRelativeToPage)
Set oFFline = ActiveDocument.Shapes.AddLine(554, i + 12, 524, i + 12)
With oFFline.Line
.Weight = 0.75
End With
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub