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
 
T

Tobias Böhm

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
 
K

Ken Slovak - [MVP - Outlook]

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
>
 
T

Tobias Böhm

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
 
K

Ken Slovak - [MVP - Outlook]

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
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 5
Cathy Rhone Mail merge error message Using Outlook 2
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
icacream content in this message could not be downloaded.... Using Outlook 2
J Outlook 2016 After a search in all mailboxes, where is each message that was found? Using Outlook 6
R Warn before sending message Outlook VBA and Custom Forms 4
T Column to display which email alias a message was sent to Outlook VBA and Custom Forms 6
V Change start time based on message duration Outlook VBA and Custom Forms 2
J Message search and edit, another way? Outlook VBA and Custom Forms 4
N VBA to delete duplicates by message-id on common pst for 2 or more emails Outlook VBA and Custom Forms 0
M VBA to auto forward message with new subject and body text Outlook VBA and Custom Forms 8
T Missing text in e-mail message after "(Please keep confidential)" Using Outlook 3
C Custom Form (seperate layout pages and message reading pane) Outlook VBA and Custom Forms 0
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
M Message list font changed after update Using Outlook 2
BretAB Is it possible to add a lookup field to a Message form? Outlook VBA and Custom Forms 4

Similar threads

Top