Jump to content

Requesting Guidance To Get Attachment - OutlookEx


Recommended Posts

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.

Link to comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...