G
Guest
I have a donations template letter that I have in Word. From access I want to pass the amount and insert it into the lette
using a bookmark. All goes well, but I lose the currency formatting. For numbers 1,000 and above, no comma appears in the word document and I can't figure out why. When I export data from the same table into Excel, I see both the comma and the dollar sign. Can you tell me what is wrong with the code below? Thank you. Mery
Private Sub Donation_Letter_Word_Click(
On Error GoTo Err_Donation_Letter_Word_Clic
Dim oApp As Objec
Set oApp = CreateObject("Word.Application"
oApp.Visible = Tru
Dim curAmount As Currenc
curAmount = Forms![Donor-Registration Form-US]![individual donations subform]!Amoun
' Open Microsoft Word using automatio
oApp.Documents.Add "C:\Windows\Application Data\Microsoft\Templates\RegDonationLetter.dot
oApp.Visible = Tru
' The following code is generated from your Access form while it i
' manipulating an instance of Word
' So, while it looks somewhat like VBA, it's really Word VBA
If oApp.ActiveDocument.Bookmarks.Exists("Amount") = True The
oApp.ActiveDocument.Bookmarks("Amount").Range.Text = curAmoun
End I
Exit_Donation_Letter_Word_Click
Exit Su
using a bookmark. All goes well, but I lose the currency formatting. For numbers 1,000 and above, no comma appears in the word document and I can't figure out why. When I export data from the same table into Excel, I see both the comma and the dollar sign. Can you tell me what is wrong with the code below? Thank you. Mery
Private Sub Donation_Letter_Word_Click(
On Error GoTo Err_Donation_Letter_Word_Clic
Dim oApp As Objec
Set oApp = CreateObject("Word.Application"
oApp.Visible = Tru
Dim curAmount As Currenc
curAmount = Forms![Donor-Registration Form-US]![individual donations subform]!Amoun
' Open Microsoft Word using automatio
oApp.Documents.Add "C:\Windows\Application Data\Microsoft\Templates\RegDonationLetter.dot
oApp.Visible = Tru
' The following code is generated from your Access form while it i
' manipulating an instance of Word
' So, while it looks somewhat like VBA, it's really Word VBA
If oApp.ActiveDocument.Bookmarks.Exists("Amount") = True The
oApp.ActiveDocument.Bookmarks("Amount").Range.Text = curAmoun
End I
Exit_Donation_Letter_Word_Click
Exit Su