vba stuff

Discussion in 'Programming & Software Development' started by philquad, Sep 12, 2020.

  1. philquad

    philquad Member

    Joined:
    Jan 22, 2004
    Messages:
    1,410
    Location:
    nelson bay
    i wanna be a script kiddy but i canT work out how to save a vba file

    excel says it needs to be macro enabled but i dont get it still

    its from here but my script doesnt show https://www.extendoffice.com/docume...o-download-save-attachments-to-folder.html#a1

    Automatically download Outlook attachments to folder with VBA and rule
    This method will introduce a VBA script, and run this scrip with a rule to automatically download and save Outlook attachments to a certain folder. Please do as follows:

    1. Press Alt + F11 keys to open the Microsoft Visual Basic for Applications window.

    2. Click Insert > Module, and then paste below VBA script into the new opening Module window.

    VBA: Auto Save Outlook Attachments into a certain folder

    1
    2
    3
    4
    5
    6
    7
    8
    Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
    Dim oAttachment As Outlook.Attachment
    Dim sSaveFolder As String
    sSaveFolder = "C:\Users\DT168\Documents\outlook-attachments\"
    For Each oAttachment In MItem.Attachments
    oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
    Next
    End Sub
    Note: Please find out sSaveFolder = "C:\Users\DT168\Documents\outlook-attachments\", and replace the destination folder’s path as you need.

    3. Save the VBA Script and close the Microsoft Visual Basic for Applications window.
     
  2. theSeekerr

    theSeekerr Member

    Joined:
    Jan 19, 2010
    Messages:
    3,527
    Location:
    Broadview SA
    So, um...you realise you're meant to be opening VBA from Outlook, not Excel, yeah?
     
  3. OP
    OP
    philquad

    philquad Member

    Joined:
    Jan 22, 2004
    Messages:
    1,410
    Location:
    nelson bay
    yea, umm ,mabe lol. think i mean saving the script, oh ok, open outlkook, got it, & see the numbers < different site, dont need them ? i try again thnx
     
  4. OP
    OP
    philquad

    philquad Member

    Joined:
    Jan 22, 2004
    Messages:
    1,410
    Location:
    nelson bay
    it work ed, stoked, can now save many souls from lost email things. how do i delete it if ?
     
  5. schnappy

    schnappy Member

    Joined:
    Apr 23, 2008
    Messages:
    843
    Location:
    3124
    Dude just pay someone for support, you will get yourself in trouble if you are putting together some sort of 'back up' or protection and don't know what you are doing.
     
  6. OP
    OP
    philquad

    philquad Member

    Joined:
    Jan 22, 2004
    Messages:
    1,410
    Location:
    nelson bay
    no not commercially, just myself & maybe a mate i host for, just for kicks.
     

Share This Page

Advertisement: