Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel Using Outlook Template (XP: SP3)

    Is it possible to utilize an outlook template in excel's vba?

    I currently have code that interacts with outlook to send an e-mail message. What I would like to do is simply create an outlook template (populated with paragraphs and some bitmap files for pictoral representation). This OL template would be called in the Excel code and eventually be e-mailed out.

    I compose e-mail in HTML and use Word to edit e-mail messages.

    Thanks,
    John

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Excel Using Outlook Template (XP: SP3)

    XL VBA does not work with outlook objects, only with XL. You can, however, have XL open an occurence of Outlook and work with Outlook VBA. ROn Debruin has Example Code for sending mail from Excel which may get you started.

    Working with Outlook is beyond my expertise and may require expertise from the outlook board, not the excel board...

    Steve

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel Using Outlook Template (XP: SP3)

    Steve,

    Thanks for the link. It does provide me examples of what i want to accomplish.

    Sub Send_Range() 'Don't forget to have the Outlook Object Library selected in the Visual Basic Editor References.

    ' Select the range of cells on the active worksheet.
    ActiveSheet.Range("A1:B5").Select

    ' Show the envelope on the ActiveWorkbook.
    ActiveWorkbook.EnvelopeVisible = True

    ' Set the optional introduction field thats adds
    ' some header text to the email body. It also sets
    ' the To and Subject lines. Finally the message
    ' is sent.
    With ActiveSheet.MailEnvelope
    .Introduction = "This is a sample worksheet."
    .Item.To = "E-Mail_Address_Here"
    .Item.Subject = "My subject"
    .Item.Send
    End With
    End Sub

    John

Posting Permissions

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