S
Stephen English
Hi
I am having great trouble controlling this.
I am tring to indert a heading before a bookmark (before so that I can
select it again and insert more stuff) and then insert a table for each
record in a recordset and I keep ending up with the table inside the table or
after the bookmark.
Are there some basic rules / methods for moving out of a table please. I
know this looks very messy and this is why I am posting this question. I
have read Cindy Meister's Introduction to Automating Tables.
All suggestions welcome!
Set rngWord = docMaster.Bookmarks("Start").Range
rngWord.Move wdCharacter, -2
rngWord.Collapse
With rngWord
.InsertAfter UCase(rs!Name) & vbCrLf
.Style = "Heading 2"
End With
rngWord.Collapse wdCollapseEnd
Set rngWord = appWord.Selection.Range
rngWord.Move wdCharacter, -1
Do Until rsOfficers.EOF
docMaster.Tables.Add rngWord, 7, 4
' add data to cells from recordset rsofficers
rngWord.Collapse wdCollapseEnd
rngWord.Move wdParagraph, 35 ' 1 for each cell + 1 for each row
Set rngWord = docMaster.Bookmarks("Start").Range
rngWord.InsertBefore vbCrLf
rngWord.Move wdCharacter, -1
rngWord.InsertBefore vbCrLf
rngWord.Collapse wdCollapseEnd
Loop
I am having great trouble controlling this.
I am tring to indert a heading before a bookmark (before so that I can
select it again and insert more stuff) and then insert a table for each
record in a recordset and I keep ending up with the table inside the table or
after the bookmark.
Are there some basic rules / methods for moving out of a table please. I
know this looks very messy and this is why I am posting this question. I
have read Cindy Meister's Introduction to Automating Tables.
All suggestions welcome!
Set rngWord = docMaster.Bookmarks("Start").Range
rngWord.Move wdCharacter, -2
rngWord.Collapse
With rngWord
.InsertAfter UCase(rs!Name) & vbCrLf
.Style = "Heading 2"
End With
rngWord.Collapse wdCollapseEnd
Set rngWord = appWord.Selection.Range
rngWord.Move wdCharacter, -1
Do Until rsOfficers.EOF
docMaster.Tables.Add rngWord, 7, 4
' add data to cells from recordset rsofficers
rngWord.Collapse wdCollapseEnd
rngWord.Move wdParagraph, 35 ' 1 for each cell + 1 for each row
Set rngWord = docMaster.Bookmarks("Start").Range
rngWord.InsertBefore vbCrLf
rngWord.Move wdCharacter, -1
rngWord.InsertBefore vbCrLf
rngWord.Collapse wdCollapseEnd
Loop