Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Table Format help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LEU - 28 Feb 2007 02:57 GMT
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
Klaus Linke - 28 Feb 2007 06:13 GMT
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

>I have the following macro that inserts a note table into my document. When
>I
[quoted text clipped - 23 lines]
> End With
> End Sub

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.