PR_MESSAGE_CLASS is reset when calling Save() on item

Status
Not open for further replies.
T

Tobias Böhm

Hello,

I'm having several problems with my Outlook-Add-In and I would

appreciate any help on this one.

To show a custom icon for items of a certain folder I set the

PR_MESSAGE_CLASS to the message class I created and the PR_ICON_INDEX

to -1. Then because of the -1 a custom icon is shown and because of

the custom message class it's the one I defined in the custom form.

Very good.

The problem starts when the user updates the item, either with an

outlook inspector or with my custom windows form. After displaying the

data in my custom windows form I persist the values, I write them back

to the outlook item and call .Save(). That resets the MessageClass

which is very odd I think because the item is not moved or something -

I just saved it.

Is this behaviour known or even wanted and if so, why?

Thank you in advance for any help.

Tobi
 
This behaviour can simply be reproduced by creating a custom form,

creating a folder and tell outlook to use the custom form. Create

item, everything is fine. Restart outlook, open one of the items, save

and the PR_MESSAGE_CLASS is gone. Oddly, outlook still opens the item

with the correct (custom) form even though there is no information

anywhere anymore that this is not a standard item.

Is this just my outlook acting weird or am I doing something wrong?

Thank you in advance.

Tobi
 
Is that custom form with that MessageClass published in Outlook? It sounds

like the form isn't published and the items are one-offed.

At any rate, just set the custom MessageClass again when the item is saved

and make sure the custom form is published.

"Tobias Böhm" <boehm.tobi@googlemail.com> wrote in message

news:531de8ba-d7f9-4764-b38d-e691ee6f9f50@v36g2000yqv.googlegroups.com...
> This behaviour can simply be reproduced by creating a custom form,
> creating a folder and tell outlook to use the custom form. Create
> item, everything is fine. Restart outlook, open one of the items, save
> and the PR_MESSAGE_CLASS is gone. Oddly, outlook still opens the item
> with the correct (custom) form even though there is no information
> anywhere anymore that this is not a standard item.

> Is this just my outlook acting weird or am I doing something wrong?

> Thank you in advance.
> Tobi
>
 
On 30 Jul., 15:14, " - " <kenslo...@mvps.org
wrote:
> Is that custom form with that MessageClass published in Outlook? It sounds
> like the form isn't published and the items are one-offed.

> At any rate, just set the custom MessageClass again when the item is saved
> and make sure the custom form is published.

> >

> http://www.slovaktech.com

> "Tobias Böhm" <boehm.t...@googlemail.com> wrote in message

> news:531de8ba-d7f9-4764-b38d-e691ee6f9f50@v36g2000yqv.googlegroups.com...
>
> > This behaviour can simply be reproduced by creating a custom form,
> > creating a folder and tell outlook to use the custom form. Create
> > item, everything is fine. Restart outlook, open one of the items, save
> > and the PR_MESSAGE_CLASS is gone. Oddly, outlook still opens the item
> > with the correct (custom) form even though there is no information
> > anywhere anymore that this is not a standard item.

>
> > Is this just my outlook acting weird or am I doing something wrong?

>
> > Thank you in advance.
> > Tobi


Thank you. After I designed the form I published (Outlook 07: "Publish

Form As") and gave an appropriate name. Then I right click on a folder

and assign that custom form to that particular folder. Then the

strange behaviour. I create an item, everything is fine. Opening,

saving, PR_MESSAGE_CLASS and the icon are correct. When I restart

Outlook the moment I save the item the PR_MESSAGE_CLASS and the icon

are gone. Strange, that can't be the desired behaviour, right? Funny

thing, Outlook still opens the item, even though there's nothing left

of my custom class, with that custim form.

I'm hacking the PR_MESSAGE_CLASS back in but that can't be it. Do you

mean a different kind of publishing?

Tobi
 
There's only one publishing that you'd use, Publish As and then selecting a

library (Personal or Organizational) or publishing to a folder. As long as

you only publish to one location and make sure to increment the Version

property of the form (a string but can be used as if an int value) things

are usually OK.

It's possible there's some form of forms cache corruption, that should be

eliminated first. Go to the Manage Forms dialog and click the button to

clear the cache. At that time make sure the form is published to the desired

location and no other.

The folder default form property just make sure your custom form is used to

create all new items in that folder.

About the only other thing I can think of is to examine one of the problem

items in a MAPI viewer such as OutlookSpy or MFCMAPI and see if you can spot

any differences between it and an item that's OK.

You aren't by any chance synching those items with some sort of PDA or IPod

or IPhone or other device? If so that might be the cause of the problem if

that synching software can't deal with custom form items and changes them

back to the standard MessageClass.

"Tobias Böhm" <boehm.tobi@googlemail.com> wrote in message

news:d7ccb583-75cc-4340-a657-50c7de1cf72f@o6g2000yqj.googlegroups.com...

<snip
Thank you. After I designed the form I published (Outlook 07: "Publish

Form As") and gave an appropriate name. Then I right click on a folder

and assign that custom form to that particular folder. Then the

strange behaviour. I create an item, everything is fine. Opening,

saving, PR_MESSAGE_CLASS and the icon are correct. When I restart

Outlook the moment I save the item the PR_MESSAGE_CLASS and the icon

are gone. Strange, that can't be the desired behaviour, right? Funny

thing, Outlook still opens the item, even though there's nothing left

of my custom class, with that custim form.

I'm hacking the PR_MESSAGE_CLASS back in but that can't be it. Do you

mean a different kind of publishing?

Tobi
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
S Unable to change Message Class Outlook VBA and Custom Forms 0
S Changing Message Class Outlook VBA and Custom Forms 4
Witzker HowTo Change message Class of contact form Outlook VBA and Custom Forms 0
S Create A Search Folder That Looks For Message Class? Outlook VBA and Custom Forms 0
W Message class changes of a custom form changes to the default form Using Outlook 2
P Message Class keeps changing back to IPM.Contact Outlook VBA and Custom Forms 2
J Outlook 2007 - Change Message Class for all Items in Folder Outlook VBA and Custom Forms 1
L Moving Message Class email via script and Rule Outlook VBA and Custom Forms 3
1 Outlook Message Class Exchange Server Administration 3
S Changed Message class; forms with data resist. Outlook VBA and Custom Forms 5
T Changing Icon of message class Outlook VBA and Custom Forms 1
Rob Can't save MailItem because the message changed in .pst file Outlook VBA and Custom Forms 0
M Search message, then (1) Jump to folder & (2) Select message that you searched for Outlook VBA and Custom Forms 7
Kika Melo How to mark as Junk any message not from Contacts (in Outlook.com) Using Outlook 3
G Outlook 365 My iCloud Outlook doesn’t work after reinstalling Microsoft365 on Windows 10 PC – now I get error message on contacts and calendar Using Outlook 1
G Get current open draft message body from VBA Outlook VBA and Custom Forms 1
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
F Outlook 2019 Forwarding Message and Keeping Unread Status Outlook VBA and Custom Forms 0
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1
C Populate form data into message body Outlook VBA and Custom Forms 1
J Outlook 365 Add keywords from Listbox to the message body where cursor is placed Outlook VBA and Custom Forms 0
B How to create a button that sorts and selects the most recent message with ONE click Using Outlook 2
P "Item could not be moved" message occurs frequently for IMAP inbox, Office 365 Using Outlook 0
A rule name into message - how? Outlook VBA and Custom Forms 5
A Links in email getting error message about group policy Using Outlook 4
O How to find and replace a word in Outlook-Agenda-Subject and Message? Using Outlook 0
X Open Hyperlinks in an Outlook Email Message (Help with Diane's solution) Outlook VBA and Custom Forms 3
Commodore Unable to move message Using Outlook 3
Y Disable Microsoft Outlook Test Message Using Outlook 4
Cathy Rhone Mail merge error message Using Outlook 1
C Can't Locate an Unread Message in my Outlook view pane Using Outlook 0
G Send a greeting message to a contact on birthday Outlook VBA and Custom Forms 5
B Inconsistent handling of message read/unread status by Outlook Using Outlook 3
N Save Selected Email Message as .msg File Outlook VBA and Custom Forms 12
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
O Outlook 2010 Add delete button to the side of the message list Using Outlook 1
Cathy Rhone The properties of the message have been changed Using Outlook 1
S Outlook 2016 A Shortcut to recall and delete and sent message. Using Outlook 1
T vba extract data from msg file as attachment file of mail message Outlook VBA and Custom Forms 1
S Unable to extract text from an Outlook email message Using Outlook 2
R Outlook 2016 Message-ID oddity/inconsistency? Using Outlook 7
J Implement Keywords based on body message Outlook VBA and Custom Forms 0
C must select message to trigger safe list Using Outlook 3
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
W September 2020 - No Default Email Client message after Office Update Using Outlook 1
A Flag Message for Follow Up after sending Outlook VBA and Custom Forms 1
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
C Why won't Title display in message list? Using Outlook 1

Similar threads

Back
Top