Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Inspector can't save the item (http://www.outlookbanter.com/add-ins-outlook/29725-inspector-cant-save-item.html)

tonyl October 12th 06 05:36 AM

Inspector can't save the item
 

I am able to catch the itemsAdd. itemsChange event. I try to add some customized
properties in that item using the IMessage by calling item.get_MAPIObject((IUnknown
**)&spIMessage) .

After made the changes within the itemsAdd/itemsChange event, I use IMessage-SaveChanges(0),
and IMessage-Release() (if IMessage is not CComPtr, I call release).

- When I use the outlookspy to check my properties from the outlook main
window, it exists.
- When open that item window, the inspector, and check the imessage properties,
they all exist.
- When I made some changes on the item, eg. add comments, and click save
button, a popup window prompt that:
"Your changes could not be saved because you don't have permission to modify
some or all of the items in this folder. Do you want to save a copy of this
item in the default folder for the item?" YES/NO

How can I solve this? because from OOM, no API let me add the customized
properties (customized named properties), therefore, I call get_MAPIObject
and use MAPI call instead.

Regards,
Tony



Ken Slovak - [MVP - Outlook] October 12th 06 03:35 PM

Inspector can't save the item
 
Outlook UserProperties are MAPI named properties.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tonyl" wrote in message
m...

I am able to catch the itemsAdd. itemsChange event. I try to add some
customized properties in that item using the IMessage by calling
item.get_MAPIObject((IUnknown **)&spIMessage) .
After made the changes within the itemsAdd/itemsChange event, I use
IMessage-SaveChanges(0), and IMessage-Release() (if IMessage is not
CComPtr, I call release).
- When I use the outlookspy to check my properties from the outlook main
window, it exists.
- When open that item window, the inspector, and check the imessage
properties, they all exist.
- When I made some changes on the item, eg. add comments, and click save
button, a popup window prompt that:
"Your changes could not be saved because you don't have permission to
modify some or all of the items in this folder. Do you want to save a
copy of this item in the default folder for the item?" YES/NO

How can I solve this? because from OOM, no API let me add the customized
properties (customized named properties), therefore, I call get_MAPIObject
and use MAPI call instead.

Regards,
Tony




Dmitry Streblechenko October 12th 06 06:53 PM

Inspector can't save the item
 
Do not call IMessage::SaveChanges; let OOM handle that (MailItem.Save) - you
just need to trick Outlook into thinking that it' been modified - something
like the following will do:

MailItem.Subject = MailItem.Subject

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"tonyl" wrote in message
m...

I am able to catch the itemsAdd. itemsChange event. I try to add some
customized properties in that item using the IMessage by calling
item.get_MAPIObject((IUnknown **)&spIMessage) .
After made the changes within the itemsAdd/itemsChange event, I use
IMessage-SaveChanges(0), and IMessage-Release() (if IMessage is not
CComPtr, I call release).
- When I use the outlookspy to check my properties from the outlook main
window, it exists.
- When open that item window, the inspector, and check the imessage
properties, they all exist.
- When I made some changes on the item, eg. add comments, and click save
button, a popup window prompt that:
"Your changes could not be saved because you don't have permission to
modify some or all of the items in this folder. Do you want to save a
copy of this item in the default folder for the item?" YES/NO

How can I solve this? because from OOM, no API let me add the customized
properties (customized named properties), therefore, I call get_MAPIObject
and use MAPI call instead.

Regards,
Tony





tonyl October 13th 06 11:17 AM

Inspector can't save the item
 
Hello Dmitry,

Thanks alot. It works.

Regards,
Tony

Do not call IMessage::SaveChanges; let OOM handle that (MailItem.Save)
- you just need to trick Outlook into thinking that it' been modified
- something like the following will do:

MailItem.Subject = MailItem.Subject

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"tonyl" wrote in message
m...

I am able to catch the itemsAdd. itemsChange event. I try to add
some
customized properties in that item using the IMessage by calling
item.get_MAPIObject((IUnknown **)&spIMessage) .
After made the changes within the itemsAdd/itemsChange event, I use
IMessage-SaveChanges(0), and IMessage-Release() (if IMessage is
not
CComPtr, I call release).
- When I use the outlookspy to check my properties from the outlook
main
window, it exists.
- When open that item window, the inspector, and check the imessage
properties, they all exist.
- When I made some changes on the item, eg. add comments, and click
save
button, a popup window prompt that:
"Your changes could not be saved because you don't have permission to
modify some or all of the items in this folder. Do you want to save
a
copy of this item in the default folder for the item?" YES/NO
How can I solve this? because from OOM, no API let me add the
customized properties (customized named properties), therefore, I
call get_MAPIObject and use MAPI call instead.

Regards,
Tony





All times are GMT +1. The time now is 08:24 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com