D
Dingbat
How can I clear the contents of a bookmark without removing the actual
bookmark.
I am populating a word document with records from an access database, then
printing the document, then moving onto the next record in the database and
repeating the exercise. However, each time I move on a record I add the text
next to the previous text rather than overwriting it.
Any help/suggestions will me much appreciated. Here is a portion of the code
I am currently using:
Do Until rst.EOF
With ActiveDocument
.Bookmarks("MailAddress").Range _
.InsertBefore rst!MailingAddr
.Bookmarks("TotalAmount").Range _
.InsertBefore FormatCurrency(rst!TotAmount, -1)
.Bookmarks("CurrentAnnualAmount").Range _
.InsertBefore rst!CurrentAnnualAmt
.Bookmarks("Description").Range _
.InsertBefore rst!Description
.Bookmarks("bkDate").Range _
.InsertBefore Date
If Not IsNull(rst!Arrears) And rst!Arrears > 0 Then
strArrearsSentence = strArrears & rst!Arrears & strArrearsEnd
.Bookmarks("Arrears").Range _
.InsertBefore strArrears
End If
.Bookmarks("Factor").Range _
.InsertBefore rst!Factor
.Printout
'Reset the bookmarks
.Bookmarks("MailAddress").Range _
.InsertBefore ""
.Bookmarks("TotalAmount").Range _
.InsertBefore ""
.Bookmarks("CurrentAnnualAmount").Range _
.InsertBefore ""
.Bookmarks("Description").Range _
.InsertBefore ""
.Bookmarks("bkDate").Range _
.InsertBefore ""
End With
rst.MoveNext
bookmark.
I am populating a word document with records from an access database, then
printing the document, then moving onto the next record in the database and
repeating the exercise. However, each time I move on a record I add the text
next to the previous text rather than overwriting it.
Any help/suggestions will me much appreciated. Here is a portion of the code
I am currently using:
Do Until rst.EOF
With ActiveDocument
.Bookmarks("MailAddress").Range _
.InsertBefore rst!MailingAddr
.Bookmarks("TotalAmount").Range _
.InsertBefore FormatCurrency(rst!TotAmount, -1)
.Bookmarks("CurrentAnnualAmount").Range _
.InsertBefore rst!CurrentAnnualAmt
.Bookmarks("Description").Range _
.InsertBefore rst!Description
.Bookmarks("bkDate").Range _
.InsertBefore Date
If Not IsNull(rst!Arrears) And rst!Arrears > 0 Then
strArrearsSentence = strArrears & rst!Arrears & strArrearsEnd
.Bookmarks("Arrears").Range _
.InsertBefore strArrears
End If
.Bookmarks("Factor").Range _
.InsertBefore rst!Factor
.Printout
'Reset the bookmarks
.Bookmarks("MailAddress").Range _
.InsertBefore ""
.Bookmarks("TotalAmount").Range _
.InsertBefore ""
.Bookmarks("CurrentAnnualAmount").Range _
.InsertBefore ""
.Bookmarks("Description").Range _
.InsertBefore ""
.Bookmarks("bkDate").Range _
.InsertBefore ""
End With
rst.MoveNext