locked
Automatic Email template fill, with recipients. RRS feed

  • Question

  • Hi

    is it possible to create a user form that automatically fills in email templates and added the appropriate recipients and attachments. All depending on what's filled in to the form, can anyone explain how I would go about doing this within Outlook. Can I connect to an excel SS to retrieve data such as contacts according to address and concern etc.?

    Thanks, please let me know.

    OutlookboyinNEED

    Saturday, September 3, 2016 4:15 PM

Answers

  • Hi OutlookboyNEED,

    According to your description, you could use Visual Basic for Applications (VBA) in any Microsoft Office application to control Microsoft Outlook. For example, if you are developing a cross-application solution using one primary application and several secondary applications, you can write VBA code in the primary application to automate Outlook to send messages and to store and retrieve information in Outlook items. For example, in Excel you can write routines that send a workbook to an Outlook distribution list.
    To control Outlook objects from outside Outlook, you must establish a reference to the Outlook object library from the project in which you are writing code. To do this, use the References dialog box in the Visual Basic Editor in the primary application. You can then write code that returns a reference to the Outlook Application object. Through this reference, your code has access to all the objects, properties, methods, and constants defined in the Outlook type library.

    For more information, click here to refer about Automating Outlook from Other Office Applications

    • Proposed as answer by David_JunFeng Tuesday, September 13, 2016 2:29 PM
    • Marked as answer by David_JunFeng Thursday, September 15, 2016 2:30 PM
    Monday, September 5, 2016 2:20 AM

All replies

  • Hi, You posted your question in the Access forum. Are you trying to do this from within Access?
    Saturday, September 3, 2016 5:52 PM
  • Everything is possible. However, you post on an Access forum and ask about Outlook. Since both products belong to the Office family they do work very well together and I've written a few (=many) lines of code that use the database in Access and the mail capacity of Outlook.

    Please elaborate some. What do you want to accomplish? What is the input data? What is the expected output?


    Best regards, George

    Sunday, September 4, 2016 2:17 PM
  • Hi OutlookboyNEED,

    According to your description, you could use Visual Basic for Applications (VBA) in any Microsoft Office application to control Microsoft Outlook. For example, if you are developing a cross-application solution using one primary application and several secondary applications, you can write VBA code in the primary application to automate Outlook to send messages and to store and retrieve information in Outlook items. For example, in Excel you can write routines that send a workbook to an Outlook distribution list.
    To control Outlook objects from outside Outlook, you must establish a reference to the Outlook object library from the project in which you are writing code. To do this, use the References dialog box in the Visual Basic Editor in the primary application. You can then write code that returns a reference to the Outlook Application object. Through this reference, your code has access to all the objects, properties, methods, and constants defined in the Outlook type library.

    For more information, click here to refer about Automating Outlook from Other Office Applications

    • Proposed as answer by David_JunFeng Tuesday, September 13, 2016 2:29 PM
    • Marked as answer by David_JunFeng Thursday, September 15, 2016 2:30 PM
    Monday, September 5, 2016 2:20 AM
  • Great answer David!

    Best regards, George

    Tuesday, September 6, 2016 2:58 PM