Page 4 of 4 FirstFirst ... 234
Results 31 to 35 of 35

Thread: Attachment Download

  1. #31
    Board Regular
    Join Date
    Aug 2012
    Posts
    438
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Attachment Download

    Quote Originally Posted by DanteAmor View Post
    Another update, try this please.

    Code:
    Sub download_attachments()
      'Dim olApp As Outlook.Application, olmail As MailItem, Att As Object
      Dim olApp As Object, olmail As Object, Att As Object
      Dim olFolder As Object, sPath As String, y As Long, strfile As String
      sPath = ThisWorkbook.Path & "\"
      '
      Set olApp = CreateObject("Outlook.application")
      Set olmail = olApp.CreateItem(0)
      Set olFolder = olApp.GetNamespace("MAPI").PickFolder
      '
      For Each olmail In olFolder.Items
        If TypeName(olmail) = "MailItem" Then
          y = 1
          For Each Att In olmail.Attachments
            strfile = sPath & olmail.Attachments.Item(y).Filename
            olmail.Attachments.Item(y).SaveAsFile strfile
            y = y + 1
          Next Att
        End If
      Next <------------- ERROR IS HERE AS 
      MsgBox "Done"
    End Sub
    ERROR IS IN Next. cannot save the attachments as user don not have the permission.
    I am surprised.

  2. #32
    MrExcel MVP ZVI's Avatar
    Join Date
    Apr 2008
    Location
    Sevastopol
    Posts
    3,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    3 Thread(s)

    Default Re: Attachment Download

    Quote Originally Posted by vmjan02 View Post
    yes. its there only.
    And does message box appear?
    Vladimir Zakharov

  3. #33
    Board Regular
    Join Date
    Aug 2012
    Posts
    438
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Attachment Download

    Yes, now I am able to download the attachments. the problem was with my outlook, so had to ask the IT guy and ye had fixed it. So now all good and cool.
    the problem as the access of mail(MIPA), now its all good

    @ZVI thanks a tone for all the support. @Dante Thanks a tone to you as well.

    You both rock. great guys. Will keep in touch with you both

  4. #34
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,897
    Post Thanks / Like
    Mentioned
    83 Post(s)
    Tagged
    15 Thread(s)

    Default Re: Attachment Download

    @vmjan02, I'm glad to know that it works for you now. Thanks for the feedback.
    Regards Dante Amor

  5. #35
    Board Regular
    Join Date
    Aug 2012
    Posts
    438
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Attachment Download

    @Dante and @Zvi,

    can you check on my new thread ""Miuns Non Working Hours"


Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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