Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jan 2002
    Washington State
    Thanked 0 Times in 0 Posts

    Modify Outlook Template from Access (A2k)

    Hello everyone!

    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:
    Dear strContactName,
    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.


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts