L
LEU
I have the following macro that inserts a note table into my document. When I
add my text the margins works just fine for the first paragraph. But if I
start a new paragraph the margin goes all the way back to the left. How do I
keep all the paragraphs lined up?
Sub NoteBox()
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _
1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
Selection.Tables(1).Rows.SetLeftIndent LeftIndent:=5.4, RulerStyle:= _
wdAdjustNone
Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=498, RulerStyle:= _
wdAdjustNone
Selection.ParagraphFormat.TabStops.ClearAll
ActiveDocument.DefaultTabStop = InchesToPoints(0.5)
Selection.Font.Underline = True
Selection.TypeText Text:="NOTE"
Selection.Font.Underline = False
Selection.TypeText Text:=":" & vbTab
With Selection.ParagraphFormat
..LeftIndent = InchesToPoints(0.75)
..FirstLineIndent = InchesToPoints(-0.75)
End With
End Sub
add my text the margins works just fine for the first paragraph. But if I
start a new paragraph the margin goes all the way back to the left. How do I
keep all the paragraphs lined up?
Sub NoteBox()
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _
1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
Selection.Tables(1).Rows.SetLeftIndent LeftIndent:=5.4, RulerStyle:= _
wdAdjustNone
Selection.Tables(1).Columns(1).SetWidth ColumnWidth:=498, RulerStyle:= _
wdAdjustNone
Selection.ParagraphFormat.TabStops.ClearAll
ActiveDocument.DefaultTabStop = InchesToPoints(0.5)
Selection.Font.Underline = True
Selection.TypeText Text:="NOTE"
Selection.Font.Underline = False
Selection.TypeText Text:=":" & vbTab
With Selection.ParagraphFormat
..LeftIndent = InchesToPoints(0.75)
..FirstLineIndent = InchesToPoints(-0.75)
End With
End Sub