Results 1 to 2 of 2
2007-04-13, 23:21 #1
- Join Date
- Jan 2002
- Washington State
- Thanked 0 Times in 0 Posts
Modify Outlook Template from Access (A2k)
In Access/VBA I know how to open a Word document where I can replace text, change formatting, etc. For example, I have a form letter that starts out:
Using VBA I can then replace strContactName with the actual name of the person I'm addressing.
This works slick.
I'd like to use this same idea with Outlook. I know how to create an Outlook email template and access it using VBA. But how can I replace text in the template like I can in Word? If I can't replace text then how can I insert a field into the template to personalize the email?
Please let me know if I didn't explain that clear enough.
2007-04-15, 20:30 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Modify Outlook Template from Access (A2k)
You wouldn't do it that way with Outlook.
If your needs are simple, you can use DoCmd.SendObject. You can set the MessageText argument to a string you can assemble any way you want. Do a search for SendObject in this forum for examples.
If your needs are more complex, you can use Automation to control Outlook from Access, much like you can control Word. But you'd have to learn Outlook VBA. Do a search for Outlook.Application in this forum for examples.