Jump to content

Recommended Posts

Posted

Dear members,

I'm trying to get the attachments from mails using OutlookEx UDF and then save them in a particular location.

The UDF considers even the signature images and other images in the mail body as attachments, and saves it in the folder I point. I want only the proper attachment documents to be saved.

Requesting the guidance of the forum members.

 

 

Thanks and regards,

Gowrisankar R.

Posted

Need furhter information ;)
Do you use _OL_ItemSave or _OL_ItemAttachmentSave?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

You mean I should have used "_OL_ItemAttachmentSave" ?

I tried that as well. 

$aOL_Item2 = _OL_ItemFind($oOutlook, $sSourceFolder1, $olMail, "", "", "", "EntryID", "", 1)
   If $aOL_Item2[0][0] = 0 Then Exit MsgBox(16, "OutlookEX UDF", "Could not find a mail item in folder '" & $sSourceFolder1 & "'. @error = " & @error)
   
   $aResult = _OL_ItemAttachmentGet($oOutlook, $aOL_Item2[1][0], Default)
   $sAttachmentFolder1 = "C:\"

   _ArrayDisplay($aResult, "D")

   DirCreate($sAttachmentFolder1)

   Local $iRowsE = UBound($aResult, $UBOUND_ROWS)
   ;_OL_ItemSave($oOutlook, $aOL_Item2[$iD][0], Default, $sAttachmentFolder1, $olHTML, 2 + 16)
   For $iE = 1 To $iRowsE - 1 Step 1
      _OL_ItemAttachmentSave($oOutlook, $aOL_Item2[1][0], Default, $iE, $sAttachmentFolder1)
   Next

 

Posted

If you grab all attachments and save them then the result will be the same.
You need to decide for each attachment if it is something you want to save or not. Make this decision by name, type, size etc.
Because Outlook doesn't make any difference between attachments added by the user or by a signature.

My UDFs and Tutorials:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...