E
Elaine
From an MS Access Database I am using bookmarks to replace text in a Word
document with text from a database field. I have 12 bookmarks that include 4
which are named POC, BusinessName, Address1 and Address2. All of the
bookmarks except these 4 are working properly in that the text is being
replaced with the information from the database. I have deleted them and
reinserted the bookmarks. I have also renamed them but these 4 don't replace
the text. I know there is information in the field, so it's not a blank
field that's causing the problem. I have several letters that need to be
automated and each one is experience the same problem with fields with these
names and I can't figure out what I'm doing wrong. Can anyone help me with
this. I'm using Office 2007 and below is the code I'm using.
With objDoc
.Bookmarks("dDate").Range.Text = Format(rst.Fields("dDate"),
"mmmm dd, yyyy")
.Bookmarks("POC").Range.Text = Nz(rst.Fields("POC"))
.Bookmarks("BusinessName").Range.Text =
Nz(rst.Fields("BusinessName"))
.Bookmarks("Address1").Range.Text = Nz(rst.Fields("Address1"))
.Bookmarks("Address2").Range.Text = Nz(rst.Fields("Address2"))
.Bookmarks("C").Range.Text = Nz(rst.Fields("C"))
.Bookmarks("BondID").Range.Text = Nz(rst.Fields("BondID"))
.Bookmarks("Acct").Range.Text = Nz(rst.Fields("Account"))
.Bookmarks("InsCO").Range.Text = Nz(rst.Fields("InsuranceCo"))
.Bookmarks("DepReq").Range.Text =
Format(Nz(rst.Fields("DepRequired")), "$#,#00.00")
.Bookmarks("DteDue").Range.Text = Nz(rst.Fields("DteDue"))
.Bookmarks("ExpDate").Range.Text = Nz(rst.Fields("ExpDate"))
End With
document with text from a database field. I have 12 bookmarks that include 4
which are named POC, BusinessName, Address1 and Address2. All of the
bookmarks except these 4 are working properly in that the text is being
replaced with the information from the database. I have deleted them and
reinserted the bookmarks. I have also renamed them but these 4 don't replace
the text. I know there is information in the field, so it's not a blank
field that's causing the problem. I have several letters that need to be
automated and each one is experience the same problem with fields with these
names and I can't figure out what I'm doing wrong. Can anyone help me with
this. I'm using Office 2007 and below is the code I'm using.
With objDoc
.Bookmarks("dDate").Range.Text = Format(rst.Fields("dDate"),
"mmmm dd, yyyy")
.Bookmarks("POC").Range.Text = Nz(rst.Fields("POC"))
.Bookmarks("BusinessName").Range.Text =
Nz(rst.Fields("BusinessName"))
.Bookmarks("Address1").Range.Text = Nz(rst.Fields("Address1"))
.Bookmarks("Address2").Range.Text = Nz(rst.Fields("Address2"))
.Bookmarks("C").Range.Text = Nz(rst.Fields("C"))
.Bookmarks("BondID").Range.Text = Nz(rst.Fields("BondID"))
.Bookmarks("Acct").Range.Text = Nz(rst.Fields("Account"))
.Bookmarks("InsCO").Range.Text = Nz(rst.Fields("InsuranceCo"))
.Bookmarks("DepReq").Range.Text =
Format(Nz(rst.Fields("DepRequired")), "$#,#00.00")
.Bookmarks("DteDue").Range.Text = Nz(rst.Fields("DteDue"))
.Bookmarks("ExpDate").Range.Text = Nz(rst.Fields("ExpDate"))
End With