I can't email/publish/save_as a report from Access 2007 unless I use .snp. I
downloaded the pdf/xps add-on from MS but when I go to publish or email I get
an error message. It basically says "Can't save to output data to file you
have selected". Then it gives fives "excuses", one being that the file may be
open. Another about having enough disk space. I have plenty. Can you help me
out on this?
Thanks
Stan
If you use outlook then
this work for me
there is another way that does require out look but I have got it to
work yet
Public Sub SendOutlookMessage( _
email_ad As String, _
strEmailCCAddress As String, _
strEmailBccAddress As String, _
strSubject As String, _
strMessage As String, _
blnDisplayMessage As Boolean, _
Optional myAttachments As String)
'* Copy this code and paste it into a new Access
'* Module. Click Tools > References and make sure
'* that "Microsoft Office Outlook x.0 Object Library"
'* is checked.
'*
'* This subroutine sends an e-mail message through
'* MS Outlook. If the "blnDisplayMessage" parm is
'* set to "False", the message is placed in the
'* Outlook Outbox. "True" displays the message, and
'* user will have to click "Send" to send it.
'*
'* Ex.:
'*
'* SendOutlookMessage _
'* "(e-mail address removed)", _
'* "(e-mail address removed)", _
'* "(e-mail address removed)", _
'* "Subject", _
'* "Body of Message", _
'* False, _
'* "C:\My Documents\MyAttachmentFile.txt"
Dim myApp As New Outlook.Application
Dim myMsg As Outlook.MailItem
Dim objOutlookRecipient As Outlook.Recipient
Dim myAttach As Outlook.attachments
Dim blnOutlookInitiallyOpen As Boolean
Dim strProcName As String
Dim Path As String
Path = DLookup("variable", "var", "varname ='GenusExport'")
On Error Resume Next
Set myMsg = myApp.CreateItem(olMailItem)
Set myAttach = myMsg.attachments
With myMsg
myAttach.Add Path & "1_Silviculture_Activity.txt"
myAttach.Add Path & "2_Silvicutlure_stratum_History.txt"
myAttach.Add Path & "3_Silvicutlure_Stocking_Status_History_I.txt"
myAttach.Add Path & "4_Silvicutlure_Stocking_Status_History_S.txt"
myAttach.Add Path & "5_Silvicutlure_Survey_Pest_Infestion.txt"
myAttach.Add Path & "6_Silvicutlure_Survey_Species.txt"
.Subject = " Genus import files"
.Body = "Here are the Genus upload tables generated from SAP." &
Chr(13) & _
"Notes:" & Chr(13) & "1) These files are comma delimited." & Chr(13)
& _
"2) Using this import may produce a double activity in Genus." &
Chr(13) & _
"If you have any problems please contact (e-mail address removed)" &
Chr(13) & _
"Thank You" & Chr(13) & Chr(13) & _
" your name"
.To = email_ad
.Display
DoEvents
End With
End Sub