Table Format help

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
 
K

Klaus Linke

It would probably be better to assign a paragraph style with the proper
hanging indent.

Not sure why you have the problem though, since Word usually keeps the
(manual) paragraph formatting when you start a new paragraph by hitting
Return.

Maybe the "Style for following paragraph" setting in the style definition
makes Word swith to another style?

Regards,
Klaus
 

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

Similar Threads

Table resizing 2
Line thickness 1
Find and Replace Question 3
Word 2007 Not responding 0
Multiple Tables 2
If Then Else question 3
Table Repeating Issue 1
Table not inserting correctly 2

Top