Outlook attachment source file path - outlook

I am using Outlook.Attachment attachment object in my C# Outlook AddIn. But the attachment object doesn't have any field which suggest what is the full source path of the file being attached.
The attachment object has the following fields/methods, but they are not helpful.
attachment.DisplayName
attachment.FileName
attachment.GetTemporaryFilePath()

There is no such thing - attachment does not have to come from the file system even it is created. After its is inserted, it is stored outside of the file system alongside messages in the store.

Related

Is there a solution to get a .msg File from the MS Graph API?

I have the task to get several Mails with the Graph API and archive those as .msg files to a server.
Right now, i'm only able to get mails as MIME. Is there a way to transform those into .msg files?
MSG file format is specific to the Windows version of Outlook. Neither Graph nor EWS expose that file format in any way. You can create an MSG file (see How to create ".msg" file without using outlook in mfc?) and import EML into it.
Also note that Outlook will be just as happy to open and display an EML file as an MSG file, so it might make sense to work with EML files, even if they don't expose all the information and MAPI specific properties that an MSG file can store.

Running Excel Scripts on Outlook Attachments then sending processed files

TL;DR: I want to extract an Excel attachment from an Outlook message, automate an Excel script on the unprocessed reports, and then send the output in a new email message.
I have reports from Amazon that I have sent to a specific email on my Outlook folder each month.
I set up Power Automate to trigger whenever an email with an attachment is received in this folder.
I want to take the attachment in this Outlook email and run an Excel script that I build on Excel Desktop (not an Excel application macro) to format the data.
And then I want to send the output/result (scripted email attachment) as the body of an email out to clients.
I've gotten the first and last parts to run, but I can't get the script to process the file, that's the phase that always breaks that automation.
Things that I think might be causing the issue:
Do I need to extract the attachment from the email and save it as a file before I can run the Excel script on it?
Does the attachment need to be saved through Share Point to be later referenced by the Excel script?
Does the script need to be on the same or different cards as previous steps?
I've seen people run the Excel script through a Scope.
I've also looked at every available YouTube video to troubleshoot this: some go over certain steps in the process, but I'm having a hard time threading everything together.
Other Things I've Tried
I also tried to build a macro that does the same thing as my Excel desktop automation, and then wrote VBA code so each time a new sheet is opened the same macro is run, processing the data. But I couldn't get it to run on any new future sheet that I open, even when writing the VBA auto-open code in Module as well as This Worksheet.
I'm open to any method that will make this work.
Get email (V2) - Message ID
#{triggerOutputs()?['body/id']}
Apply to Each - Select an output from previous steps
#{outputs('Get_email_(V2)')?['body/attachments']}
Create File - File Name
#{items('Apply_to_each')?['name']}
Create File - File Content
#{items('Apply_to_each')?['contentBytes']}
Move or rename a file - File (make sure you add .xlsx for Destination File Path)
#outputs('Create_file')?['body/Id']
Run Script - File
#outputs('Move_or_rename_a_file')?['body/Id']
Get file content - File
#outputs('Move_or_rename_a_file')?['body/Id']
Send an email (V2) - Attachments Name-1
#outputs('Move_or_rename_a_file')?['body/DisplayName']
Send an email (V2) - Attachments Content - 1
#body('Get_file_content')?['body']

MAPI - Find file containing MAPI URL (or open message)

I'm using Windows Search API, which returns mapi URLs.
How can I find the file which contains the data for the URL? E.g. the path to the PST file from which that message came?
How can I programatically get the contents or data of the MAPI message (i.e. as opposed to just opening it up with the shell).
Usually MAPI allow you to invoke a method that retrieves a IMAPITable associated to an object and then sets its columns accordingly to the properties you want to query
check this out
]

Enabling search on attachment names for email documents archived through IBM Content Collector

We need to be able to search on email attachment names (Name of the files attached to an email archived in FileNet through IBM ICC Microsoft Exchange email connector)
If we just enable CBR on the object store, we are able to search the text in attachment body but not the attachment names.
Another approach we thought of is to save the attachment names in a metadata property. But issue here is, we are not able to extract the attachment names in ICC. Please suggest any approach for this.
Could you check the filename in the content element of created document for attachment.
If the filename contains the original attachment name, you can copy this value into DocumentName property throught handler action or pre-processor action.

get attachment id from redemption or RDO MAil

I'm developping an outlook addIn using C# and I need to get attachment id from redemption or RDO MAil.
how's that?
Thank you
Outlook attachments (unlike messages) do not have unique ids since they only exist in the context of their parent messages.
PR_ATTACH_NUM property is used to open attachments - http://msdn.microsoft.com/en-us/library/office/cc841969.aspx.
But that property is not guaranteed to stay the same when a message is opened. More than that, the value of the PR_ATTACH_NUM property can differ depending on whether you retrieve it from the attachment table or from the attachment itself. Below is example from OutlookSpy (I am its author):
What exactly are you trying to do?
I was trying to replace attachment with a link in async callback method and I needed to detect which attachment to replace.
I used as flag the contentID of the Interop.Redemption.RDOAttachment Object and it worked fine, Thank you .

Resources