Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word VBA - Inserting a Paragraph into an Existing Outline

Status
Not open for further replies.

BeckyMack

Programmer
Apr 15, 2008
5
US
The following code works just fine for looping through a recordset in MS Access and outputting data to a specific bookmark in an MS Word file. This could output one memo field or several depending on openrecordset finds.

The problem is that the paragraphs are getting inserted to a specific outline that is already numbered and this recordset could also spur off a sub record set underneath it.

How do I maintain numbering if I'm going to insert various paragrpahs. I've tried turning off numbering for the whole document and turning it back on but that did not help as MS Word renumbered incorrectly.

I've found a couple articles about renumbering in MS Word but I'm not sure they're the right approach. Suggestions for best practice would be appreciated!



Set RST6 = DB.OpenRecordset(MySQL, dbOpenDynaset)
RST6.MoveFirst
If Not (RST6.BOF And RST6.EOF) Then
Do While Not RST6.EOF
WordObj.Selection.Range.Text = RST6!NOVNRELanguage & vbCr & vbCr
RST6.MoveNext
Loop
RST6.Close
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top