J
Jennifer Verdam-Woodward via OfficeKB.com
Hi All
I have a bit of code in Access that on the push of a button writes a
report to a pdf and attaches the pdf to an email. Anyway, I have a
watermark that goes across the report preview that indicates the report was
emailed on this date and time once this has been done. My boss would like
this to happen only if the email was sent. Right now pushing the button is
all that it needs to fill in the watermark and cancelling the email has no
effect.
This is the code so far:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptQuoteLetter"
stLinkCriteria = "[Job Number]=" & Me![Actual_No]
SetDefaultPrinter ("PDF995")
pdfwrite "rptQuoteLetter", "C:\EmailPDF\"
SendMessage "C:\EmailPDF\rptQuoteLetter.pdf"
SetDefaultPrinter ("\\100.100.100.150\Print")
The last bit needs to be something along the lines of
If <whatever I call the message - need help>.Sent = True Then
Me![EmailedDate].Value = Now()
End If
But I am not sure what would refer to the message. I have three modules
running that let me change the default printer, write to a pdf, and display
the message, but the message has to be sent manually for a number of
reasons (not least of which is getting around Outlook's unhappiness when
another application attempts to access its address books, so Access pretty
much ends at .Display). Getting another field to populate when the message
was sent would work but I don't know how to do that.
Thanks in advance
Jen
I have a bit of code in Access that on the push of a button writes a
report to a pdf and attaches the pdf to an email. Anyway, I have a
watermark that goes across the report preview that indicates the report was
emailed on this date and time once this has been done. My boss would like
this to happen only if the email was sent. Right now pushing the button is
all that it needs to fill in the watermark and cancelling the email has no
effect.
This is the code so far:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptQuoteLetter"
stLinkCriteria = "[Job Number]=" & Me![Actual_No]
SetDefaultPrinter ("PDF995")
pdfwrite "rptQuoteLetter", "C:\EmailPDF\"
SendMessage "C:\EmailPDF\rptQuoteLetter.pdf"
SetDefaultPrinter ("\\100.100.100.150\Print")
The last bit needs to be something along the lines of
If <whatever I call the message - need help>.Sent = True Then
Me![EmailedDate].Value = Now()
End If
But I am not sure what would refer to the message. I have three modules
running that let me change the default printer, write to a pdf, and display
the message, but the message has to be sent manually for a number of
reasons (not least of which is getting around Outlook's unhappiness when
another application attempts to access its address books, so Access pretty
much ends at .Display). Getting another field to populate when the message
was sent would work but I don't know how to do that.
Thanks in advance
Jen