Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Outlook Contacts to set email address in report 1

Status
Not open for further replies.

tricky29

Technical User
Feb 11, 2001
41
GB
I seem to be struggling to get access 2000 to use the email address that is taken from my Contacts in Outlook.

So far I have linked the table in outlook into access, but when i put in a 'persons name' in the field below, i get an error saying the contact is unknown despite it being in the Contacts in Outlook.

What am I not doing?


stDocName = "A - Results"



DoCmd.SendObject acReport, stDocName, "Snapshot Format", "persons name", , , "SOLD CASE", "Details of yesterday's Presentation attached", no
 
When you say "persons name" are you providing the email address from the address book or the actual persons name. The parameter in questions here should be the email address of the person to receive the report. You can have multiple email addresses seperated by a semi-color also.

Hope this helps.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Thanks for the clarification. I was hoping there was a way to use a persons name so as if their email address changed then it would be automatically updated without the need to go back into the code and physically change it
 
Thanks for the star. Much appreciated. But, if you have linked the Address file in your database then you should be able to select the actual address from the file rather than the name. Just adjust the parameter to this email address field name and that should work for you. You can just do a DLookup to the table with the Persons Name and when found bring back the email address associated with it. By assigning this email address to a variable and then using that variable as the parameter in the SendObject command you are assuring you are using the correct address at all times.

Good luck.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Thank you again, I was planning to try that but having seen loads of code on tek tips ,it gave the impression that the name would automatically return the email address. I can now go forward and complete my work. Thank You.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top