Results 1 to 3 of 3

Thread: Outloo Automation help required

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    527

    Outloo Automation help required

    I am doing a drag & drop to my vb app and it works to a degree.

    How can i tell which file has been dropped and only save that one.

    if there are 3 attachments and i drag no 2, is there a flag like .attachments.selected so i can loop thru and only save the one selected


    Code:
    With GetObject(, "Outlook.Application")    'New Outlook.Application
                With .ActiveExplorer
                    With .Selection
                        'MsgBox .Count
    
                        With .Item(1)
    
    
    
                            For j = 1 To .attachments.Count    'the number of attachments to the email
    
                               if itemselected then  '<<<<<<<  this is what i need to find
    
                                .attachments(j).SaveAsFile tempExcelPath
    
                              end if 
    
    
                            Next
                        End With
    
                    End With
                End With
    End With

  2. #2
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,066

    Re: Outloo Automation help required

    not sure but try it with .. AttachmentSelection


    Code:
    '...
      With .ActiveExplorer.AttachmentSelection
    '...
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2011
    Posts
    527

    Re: Outloo Automation help required

    Quote Originally Posted by ChrisE View Post
    not sure but try it with .. AttachmentSelection


    Code:
    '...
      With .ActiveExplorer.AttachmentSelection
    '...
    tks, but does not seem to work the way it should.

    There is a niggle that if you drag the attachment and drop on vb app , the count is always Zero.
    You first have to left click & select and then drag & drop then you get a file count.

    Even after that i cannot seem to get the filename.

    I cannot believe Microsoft have not added a way to loop through attachements and find one or more that are selected from VB

    If anyone else knows that would be great.

Posting Permissions

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



Click Here to Expand Forum to Full Width