Results 1 to 10 of 18

Thread: Excel VBA to Attach File And Automatically Send Email

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0
    Morning Malay

    unfortunately I am not all that informed on this subject, as I only ever needed it to generate new mails. I have never worked with reading them or forwarding them.

    For the record I have just tried to send an email, that has attachments & was saved in a folder, as an attachment. it worked fine with the attachments and formatting.

  2. #2
    Junior Member
    Join Date
    Jul 2013
    Posts
    9
    Rep Power
    0

    Lightbulb Forward outlook mails with excel VBA

    Hi,

    Thank you very much for the support. I could not able to forward the mail but succeed to read the content and paste in another mail and then send to the mail id. I manage to find this code from Ms office help but can't execute it successfully, showing an error message "Run time error 438 Object doesn't support this property or method" at line "Set myinspector = Application.ActiveInspector" in MS office 2007. Please help me to solve this problem and I think my purpose will be solved manipulating the below formula.

    Thanks.
    Code:
    Sub RemoveAttachmentBeforeForwarding()
        Dim myinspector As Outlook.Inspector
        Dim myItem As Outlook.MailItem
        Dim myattachments As Outlook.Attachments
    
        Set myinspector = Application.ActiveInspector
        If Not TypeName(myinspector) = "Nothing" Then
            Set myItem = myinspector.CurrentItem.Forward
            Set myattachments = myItem.Attachments
            While myattachments.Count > 0
                myattachments.Remove 1
            Wend
            myItem.Display
            myItem.Recipients.Add "Dan Wilson"
            myItem.Send
        Else
            MsgBox "There is no active inspector."
        End If
    End Sub
    Last edited by Excel Fox; 07-08-2013 at 02:09 PM. Reason: Code tags added

Similar Threads

  1. Replies: 2
    Last Post: 05-23-2013, 08:08 AM
  2. Replies: 1
    Last Post: 05-22-2013, 01:50 PM
  3. How To Send Outlook Email Using VBA
    By mfaisalrazzak in forum Excel Help
    Replies: 7
    Last Post: 03-03-2013, 03:09 AM
  4. Send Mail Using VBA In Excel And Attach Files
    By macenmin in forum Excel Help
    Replies: 1
    Last Post: 08-03-2012, 01:03 AM
  5. Send Lotus Notes Email Using VBA
    By ramakrishnan in forum Excel Help
    Replies: 1
    Last Post: 09-08-2011, 09:00 AM

Posting Permissions

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