Getting MAPI_E_COMPUTED when altering PidTagBlockStatus in OutlookSpy - outlook-2010

I have .MSG file for which I cannot change PR_BLOCK_STATUS (PidTagBlockStatus). If I change it with OutlookSpy or MFCMapi, I'm getting MAPI_E_COMPUTED.
Outlook also displays an error when saving this message (it happens after the user clicks Display external images, then closes the message, Outlook displays "Save changes?" dialog and the user agrees).
However, PidTagBlockStatus is not a computable property. I can't understand why this happens. I have another .MSG file which is almost the copy of the first one (OutlookSpy and MFCMapi show that both .MSG files have identical fields/values) but for this file I can set PR_BLOCK_STATUS. However, these files have different length and low-level utils like SSView show that larger (and "working") file has more fields. These mysterious fields, however, are not displayed in OutlookSpy or MFCMapi.
The problem is not related to incorrect setting of PidTagMessageDeliveryTime as both messages (working and non-working) have the same PidTagMessageDeliveryTime (and other fields as well). Outlook itself (which knows how to properly set PR_BLOCK_STATUS from PidTagMessageDeliveryTime) cannot complete message save operation.
"Working" file was saved directly from Outlook, "non-working" - with a third-party software. I need to find a way to "fix" the non-working file to make it possible for Outlook to save PR_BLOCK_STATUS without issues.
One more thing. It's possible to simply delete PR_BLOCK_STATUS from .MSG at all. This, however, has an effect that once the user clicked Display external images, Outlook correctly sets PR_BLOCK_STATUS but the message gets blank in Outlook until it's opened next time. So this method does not work for me either. For that, I'm adding PR_BLOCK_STATUS to the message and setting it to zero (letting Outlook calculate the correct value if the user decided to display external pictures). With the default value of zero, Outlook normally shows the message after "Display external images" click, but fails to update the .MSG file on closing the message.
Another method would be calculation of PR_BLOCK_STATUS in "show external images" state in advance (like it's described at html email outlook asks to download images topic), but I can't get this as this must be the user's decision for each particular message, not mine.
Links to .MSG files (good/working and bad/non-working)
https://dl.dropboxusercontent.com/u/18102725/msgs.zip
Using Outlook 2010 64-bit, Windows 7 Ultimate, OutlookSpy 3.7 64-bit.

MSG files let you set any property, including PR_LAST_MODIFICATION_TIME or PR_ENTRYID. How does third party software create the MSG files? Have you looked at the MSG files using the OLE Storage viewers, such as Structured Storage Viewer (http://www.mitec.cz/ssv.html)?

Related

Save Email attachments to Google drive Attachment name deletes the letter automatically

I have created the flow to save my outlook attachment to save it google drive as a separate folder when ever I receive email with attachment.
But the problem is on the below highlighted screenshot when I type really slowly to the core Attachments From in the folder path it works but if I do the normal typing it keeps on deleting the letter. Any idea how to fix this behavior.
The point is you probably have selected some destination folder from drop-down menu and that is why such a miracle happens. And I guess it is not a bug but a feature.
How to overcome that? Just type/paste your desired value or add a dynamic content (or both).

Creating link to Outlook messages

Outlook 2007
While composing a new message in outlook can a link be created to other messages?
Whww I am composing a new mail I would like to create a link to asent item, clicking this link should then open the message.
Can this be done?
Microsoft has a support KB on hyperlinks to access Outlook folders and items:
http://support2.microsoft.com/kb/158135
However, the Outlook: scheme is not registered by default with newer versions of outlook.
http://www.slipstick.com/outlook/using-outlook-links/
I verified that the registry editing technique to associate "outlook:" with opening Outlook items ( http://www.slipstick.com/problems/outlook-missing-outlook-protocol/ ) works for Outlook 2013 on Windows 8.1, so I imagine it would work for earlier versions too.
I needed to do the same thing in Outlook 2013. I was able to do so without any registry editing. (I believe such editing is only necessary if you want the links to work outside of Outlook)
I wanted to create a link to an email that I had stored in the following Outlook folder: My Projects\Set 1\. The subject line of the email was Testing links. Here's the steps to do so:
Right-click on the folder in which the target email is stored -> Choose Properties...
Copy the full Location path (in my case this was \\MyEmail#my.domain\My Projects. (Note that this doesn't include the parent folder itself; Use the description box (or some other convenient location) to paste that path, then append the folder. So in my case the full path looked like \\MyEmail#my.domain\My Projects\Set 1.
Open up the email that you want to paste the link into.
Create a normal hyperlink
In the Address field type Outlook: followed by the path you created in Step 2 above, followed by a backslash and tilde, followed by the subject line of the target email. So for me, that whole address looks like this: Outlook:\\MyEmail#my.domain\My Projects\~Testing links
Done.

Outlook MailItem opened from standalone file, or not?

I'm developing an Outlook addin in C# and have a problem distinguishing mails opened from a folder (Inbox, Sent etc) from mails opened from a standalone .msg file.
I've tried inspecting the Parent property, but it shows Inbox for both kinds.
Any ideas out there?
/Sam
Looking through the properties, it looks to me that the .EntryID property is blank if the MailItem is opened from the file system, and has a value if the file is opened from within a folder. This makes sense based on the help entry for it; one caveat is that you'd also expect this property to be blank if the message is a new message (i.e. hasn't been saved in a folder, but doesn't exist in the file system either).
From the help concerning blank values:
Therefore, the EntryID property is not
set for an Outlook item until it is
saved or sent
You'd want to experiment with it and make sure it definitely behaves correctly before you implemented it :)
Failing all THAT, the next step could be complex; one approach would be to inspect the handles opened by Outlook. Inspecting them (in a non-priveleged context) via Process Explorer shows that there is a handle for each message; the name of the handle matches the message subject, the path is the file's path. One solution to enumerate these is in this answer.
HTH,
Geoff

Outlook 2007 add-in - What event occurs when an user moves an email from a folder to another one?

I am writing an Outlook 2007 add-in. I would like to know what event occurs when user moves an email from a folder to another one (with drag and drop or with move to folder option). My application represents a spam filter, I have a Spam folder, and I need to know whenever user moves an email form inbox to spam or form spam to inbox (this means for me that the email was wrong classified and I have to retrain it).
Thanks
Install the tool Outlook Spy then try out your experiment and see what events Outlook fires under the hood
how about Folder.BeforeItemMove?
Spambayes is a popular Open Source spam filter, which works exactly the way you describe - have a look at how it does it.

Is it possible to replace the system open file dialog?

I want to replace the standard system open file dialog with the one I wrote, that means no matter within which programs you are opening a file, my dialog will be shown instead of the standard one, is this possible?
It seems that that there is no such API provided to accomplish this, is it possible to use some hooking technique, but this has to be reliable and not to be treated as spyware by anti-virus tools?
any other options?
If this is not possible, is it possible to add to the spacebar or toolbar in the standard open file dialog a button which invokes my dialog, which allow users select a file and in turn returns the path of the selected file to the "File name" input box of the standard dialog?
Any hits, links and code examples will be appreciated.
Starting in Vista, the FileOpen/FileSave dialogs are now "Common Item Dialogs" of which IFileOpenDialog & IFileSaveDialog are the two published implementations.
Since they're just COM objects with known CLSIDs you might get away with just replacing them by re-registering using their CLSIDs. Never tried something like that, might trip all sorts of alarm bells.
Pre-Vista file dialogs can be hooked in process, but I've never come across anything about global hooks or equivalent.
If you copy a file/folder to a dialog's filename field it usually pastes the full path anyway.
For example, if you have open both a program calling the standard open/save dialog box and also have a window open at the file or path that you want to work with (open from/save to), you can simply copy the file/folder from the explorer window, and then paste into the filename field of the dialog box, and it will insert the full path of the file/folder. No custom script is required!
Alternatively, for those programs that use custom dialog boxes where this step fails, copy the same file/folder in the window into the address bar of the same window (assuming it is visible). This will paste the full path, which you can copy again, and then paste this full path into the custom dialog box. I often use this when creating Office hyperlinks (Ctrl+K), because the Insert Hyperlink dialog does not work for the first method.
You can also use similar methods but paste into address bar fields and it works.

Resources