Results 1 to 2 of 2

Thread: Email PDF Macro

  1. #1
    Join Date
    Apr 2012
    Posts
    1

    Email PDF Macro

    Hi,
    I need some help. I currently have a Macro that we use for reporting that runs and automatically PDF's the report for multiple different locations.
    But what I need is a Macro to automatically send out an email of each locations reports to the desired person. I also have three to four people I need to CC depending on who I'm sending to. The title will need to change for each email as the location will be added to the title. I also want to add a message in the email and signature.

    Any helps would be great, I assume I will need to create a spreadsheet with contact info for each recipient, CC list and path location of file.

    Thank you

  2. #2
    Join Date
    Jan 2006
    Posts
    605

    Re: Email PDF Macro

    I think that you can use CDO and avoid outlook entirely and use the below macro:

    Code:
    Dim iMsg As Object 
    Dim iConf As Object 
    Dim Flds As Variant 
     
    Set iMsg = CreateObject("CDO.Message") 
    Set iConf = CreateObject("CDO.Configuration") 
     
    iConf.Load -1 ' CDO Source Defaults
    Set Flds = iConf.Fields 
    With Flds 
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.yourserverhere.com" 
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ' usually 25
        .Update 
    End With 
     
    With iMsg 
        Set .Configuration = iConf 
        .To = "receiver@whereever.com" 
        .CC = "" 
        .BCC = "" 
        .From = "you@whereever.com" 
        .Subject = "" 
        .TextBody = "" 
        .Send 
    End With

Similar Threads

  1. Replies: 3
    Last Post: 25-01-2012, 12:03 PM
  2. Replies: 2
    Last Post: 11-01-2012, 06:06 PM
  3. Macro to convert file into PDF and then send via email
    By MAGALY in forum Software Development
    Replies: 5
    Last Post: 09-12-2009, 05:00 PM
  4. Replies: 4
    Last Post: 07-03-2008, 07:13 AM
  5. Replies: 2
    Last Post: 14-02-2008, 09:16 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,555,971.08562 seconds with 17 queries