Automatic sending of ACCESS reports by email
QSE
Posted messages
2
Registration date
Status
Member
-
Philippe -
Philippe -
Hello everyone,
Here, I am "tinkering" with Access. But I'm seriously stuck on the following problem: I periodically edit a report displaying data sorted by page, by person's names. These sheets are sent by mail. I want to send them by E-Mail, and I can't find a solution to send the page related to a person to their E-Mail address, except to send them the entire document via the "SendObject" action from the Macro commands. Or, how to automate this sending from a table of people with an E-Mail?
Thanks for any help provided.
Best regards,
JM
Here, I am "tinkering" with Access. But I'm seriously stuck on the following problem: I periodically edit a report displaying data sorted by page, by person's names. These sheets are sent by mail. I want to send them by E-Mail, and I can't find a solution to send the page related to a person to their E-Mail address, except to send them the entire document via the "SendObject" action from the Macro commands. Or, how to automate this sending from a table of people with an E-Mail?
Thanks for any help provided.
Best regards,
JM
2 answers
Hello,
Here is the click action needed to activate the function located further down. According to my documentation, this code is suitable for Outlook 2000.
I was able to verify that everything works correctly under ACCESS 2000 + Outlook 2000.
Perhaps you can adapt it to your context? It's up to you to decide if it's relevant in your case.
_________________
Private Sub ContactOutlook_Click()
'Opens an Outlook Contact for this assignment.
If Not IsNull(DestinéA) Then
OpenOutlookContact DestinA.Column(1)
End If
End Sub
_______________________
Public Sub OpenOutlookContact(strFullName As String)
'Opens a Microsoft Outlook contact for the specified name.
Dim appOutlook As New Outlook.Application
Dim nsOutlook As NameSpace
Dim mfContacts As MAPIFolder
Dim ciContact As ContactItem
'Opens the default Contacts folder in Outlook.
Set nsOutlook = appOutlook.GetNamespace("MAPI")
Set mfContacts = nsOutlook.GetDefaultFolder(olFolderContacts)
'Finds the contact called in the DestinéA column.
Set ciContact = mfContacts.Items.Find("[FullName] = " & strFullName)
'If the contact does not exist, create a new contact.
If ciContact Is Nothing Then
Set ciContact = mfContacts.Items.Add
ciContact.FullName = strFullName
End If
'Opens the Outlook Contact window.
ciContact.Display
End Sub
________________
Best regards
Science only finds what has always existed.
Hubert REEVES.
Here is the click action needed to activate the function located further down. According to my documentation, this code is suitable for Outlook 2000.
I was able to verify that everything works correctly under ACCESS 2000 + Outlook 2000.
Perhaps you can adapt it to your context? It's up to you to decide if it's relevant in your case.
_________________
Private Sub ContactOutlook_Click()
'Opens an Outlook Contact for this assignment.
If Not IsNull(DestinéA) Then
OpenOutlookContact DestinA.Column(1)
End If
End Sub
_______________________
Public Sub OpenOutlookContact(strFullName As String)
'Opens a Microsoft Outlook contact for the specified name.
Dim appOutlook As New Outlook.Application
Dim nsOutlook As NameSpace
Dim mfContacts As MAPIFolder
Dim ciContact As ContactItem
'Opens the default Contacts folder in Outlook.
Set nsOutlook = appOutlook.GetNamespace("MAPI")
Set mfContacts = nsOutlook.GetDefaultFolder(olFolderContacts)
'Finds the contact called in the DestinéA column.
Set ciContact = mfContacts.Items.Find("[FullName] = " & strFullName)
'If the contact does not exist, create a new contact.
If ciContact Is Nothing Then
Set ciContact = mfContacts.Items.Add
ciContact.FullName = strFullName
End If
'Opens the Outlook Contact window.
ciContact.Display
End Sub
________________
Best regards
Science only finds what has always existed.
Hubert REEVES.
Hello,
I have the same problem as JM, dated August 31, 2006,
namely: << I periodically edit a report displaying data sorted by page, by names of individuals. These sheets are sent by mail. I want to send them by email, and I cannot find a solution to send the page concerning a person to their email address. How can I automate this sending from a table of people with an email? >>
I do not understand the answer given to JM.
Can you clarify this topic for me?
Thank you for any help provided.
Sincerely
Philippe
I have the same problem as JM, dated August 31, 2006,
namely: << I periodically edit a report displaying data sorted by page, by names of individuals. These sheets are sent by mail. I want to send them by email, and I cannot find a solution to send the page concerning a person to their email address. How can I automate this sending from a table of people with an email? >>
I do not understand the answer given to JM.
Can you clarify this topic for me?
Thank you for any help provided.
Sincerely
Philippe
I will try it this weekend.
Best regards,
Jean Mazauric