MessageClass Property of a Post

G

Geoff

Using VBA, I extracted text from 200 rows of a Word table and created 200
Post Items. I wanted the Posts Items displayed in an Outlook form I'd
designed, so VBA set the MessageClass property of each Post Item to:

objMYPOST.MessageClass = "IPM.Post.My Form"

The result was that the posts could not be viewed in the Preview Pane
because Outlook said they contained Active content.

Is there any way to set a custom form for a post and get it displayed in the
Preview Pane?

TIA
Geoff
 
G

Geoff

Postscript from Geoff:

In case it makes any difference:

To copy the formatting in the Word document to the Post Items, used these
steps:

1. I copied each Word cell to a blank document using the FormattedText
property of Word's range object, eg:

objRNG_TARGET.FormattedText = objRNG_SOURCE_CELL.FormattedText

2. I then used the "wdFormatFilteredHTML" constant with the SaveAs method
on the target document to save the document in HTML format, without, I
hoped, any active content.

3. I read the resultant text (.htm) file using VBA's Open method to
capture the ASCII text.

4. I set the HTMLBody property of the Post Item to the text I'd captured.

I would have thought this method would ensure that the Post Items did not
contain any Active content.
But Outlook complains that they do!

Any help would be appreciated.
TIA
Geoff
 
S

Sue Mosher [MVP-Outlook]

The "active content" refers to the form, not the HTML content. If there is code behind the custom form, items created with that form won't be visible in the reading pane. The Body text will, however, be visible in AutoPreview.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Geoff

Many thanks for your reply.
There is no code behind the custom form. The custom form consists of four
textboxes (and three labels) to display:

1. Custom date field.
2. Custom number field.
3. Outlook's Importance field.
4. Outlook's Body text field (in HTML format).

I have not experimented with removing the custom fields from the custom form
because that would defeat the purpose of the form. However, I am wondering
if it's the custom fields that are preventing the Post Items from displaying
in the Preview Pane. None of the fields (as far as I know) contain "Active"
content. The VBA code that created the 200 Post Items merely assigned a
date string to the date field, an integer to the number field,
olImportanceHigh or olImportanceNormal to the Importance field, and filtered
HTML ASCII text (captured from a Word document) to the HTMLBody field.

I now have an odd situation. If the user chooses to add a Post Item using
the custom form, then the user can enter data into the two custom fields but
the resulting Post Item will not display in the Preview Pane. On the other
hand, the 200 Post Items (created by VBA code behind a Word document) will
display in the Preview Pane (because the MessageClass property wasn't set),
but, when the Post Items are opened, the values of the custom fields are not
displayed (obviously).

My priority is to show the Post Items in the Preview Pane. Therefore, I'm
guessing I'll have to abandon the custom form and use a macro assigned to a
toolbar button to capture the custom field values for new Post Items. This
doesn't feel like a neat solution. I assume I'm up against a limitation of
Outlook's product design.

Many thanks for the tip about using AutoPreview. This isn't quite what's
needed for this application (as it only displays 3 lines of body text).

Incidentally, I'm using Outlook 2002.

Again, many thanks for your interest and reply.
If there's anything else I could try, I'd be very glad to hear.
Best regards
Geoff.



The "active content" refers to the form, not the HTML content. If there is
code behind the custom form, items created with that form won't be visible
in the reading pane. The Body text will, however, be visible in AutoPreview.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

I create and published a new post form, adding just the 3 extra fields described below and have no problem seeing the body and header in the reading pane under Outlook 2003. (My 2002 machine isn't accessible right now.)

Maybe the fix described at http://support.microsoft.com/?kbid=331788 applies.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Geoff

Many thanks for your reply.

I've looked at the knowledgebase article. The article says that Service
Pack 3 for Microsoft Office XP fixes the problem. However, I have Service
Pack 3 for Microsoft Office 2002 installed and I confirm that it has not
fixed the problem on my computer - that is, Post Items created by the user
using the custom form will not display in the Preview Pane (because Outlook
2002 complains they contain Active Content), whereas Post Items created
using the standard form will display in the Preview Pane. (I assume Outlook
2002 still uses the term Preview Pane and Outlook 2003 uses the term Reading
Pane.)

I have not applied the hot-fix or edited the registry, as it seems these
alternatives should be unnecessary given that Service Pack 3 is installed.

It is odd, isn't it? This is a problem acknowledged and fixed by Microsoft,
but the fix isn't working on my system.

Many thanks for the lead to the KB article. It seems spot on - even though
I'm still experiencing apparently inappropriate behaviour by Outlook 2002.
..

If you have any further thoughts, I'd be very glad to hear.
Best regards
Geoff.



I create and published a new post form, adding just the 3 extra fields
described below and have no problem seeing the body and header in the
reading pane under Outlook 2003. (My 2002 machine isn't accessible right
now.)

Maybe the fix described at http://support.microsoft.com/?kbid=331788
applies.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

It's the registry value that should make the content visible. Try adding it.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Geoff

Many thanks for your reply.

As you indicated, the registry key did make the content visible - but not
quite as I had hoped or expected.


This is what I did to the Registry:

HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Custom
Forms\Preview

First, the "Custom Forms" and "Preview" keys were not present on my system,
so I added them.

In the Preview key, I added a string value for my custom form
(IPM.POST.Patent Archive Post Form) and set its value data to IPM.POST.


This is what I found in Outlook:

I returned to Outlook and created a new Post Item using the custom form. As
expected, I was able to enter data into the custom fields (Item and Date)
and the three other Outlook fields (Importance, Subject and Bodytext).

After posting the Post Item, only the Subject and Bodytext fields appeared
in the Preview Pane. (It would be nice if the other fields appeared too, but
it's not the end of the world because the custom fields can be still be seen
in the list of Post Items above the Preview Pane.)

What's of more concern is that when I now open the custom Post Item, it
shows in the regular Post Item form. Also, if I then open the Edit menu and
select Revise Contents, it remains in the regular Post Item form. This
means the user does not have access to the custom fields, should they need
to be revised.

Many thanks for getting me this far forward. I feel as though I'm nearly
home-and-dry. If there are any further refinements you know of, I'd be glad
to hear. I'm sorry I don't know enough at this level to take it forward
myself.

Best regards
Geoff



It's the registry value that should make the content visible. Try adding it.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

After posting the Post Item, only the Subject and Bodytext fields appeared
in the Preview Pane. (It would be nice if the other fields appeared too, but
it's not the end of the world because the custom fields can be still be seen
in the list of Post Items above the Preview Pane.)

That's exactly what you'd see if the item used the regular Post form. That's the way it's designed to work.
What's of more concern is that when I now open the custom Post Item, it
shows in the regular Post Item form. Also, if I then open the Edit menu and
select Revise Contents, it remains in the regular Post Item form. This
means the user does not have access to the custom fields, should they need
to be revised.

When you designed the form, did you click the Edit Read Layout button and create a read layout showing your custom fields?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Geoff

Many thanks for your reply and continued support.
When you designed the form, did you click the Edit Read Layout button and
create a read layout showing your custom fields?

I thought that I had. But to confirm, I have opened my custom form in
design view and I have clicked the "Edit Read Page" and "Edit Compose Page"
buttons. The layout is the same on both pages.

Therefore, I have composed a new custom form with same user-defined fields
and with different layouts for the compose and read pages. This is how a
Post Item behaves when it's created with the new custom form - when there
is, and isn't, a registry string value for the new custom form in:

HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Custom
Forms\Preview

1. Without a registry string value, the Post Item did not display in the
Preview Pane because of its "active content". When the Post Item was
opened, it displayed in the "Read" page layout of the new custom form. When
I then opened the Edit menu and selected Revise Contents, it displayed in
the "Compose" page layout of the custom form.

2. With a registry string value, the Post Item did display in the Preview
Pane. However, when the Post item was opened, it displayed in the regular
Post Item form. And when I then opened the Edit menu and selected Revise
Contents, it continued to be displayed in the regular Post item form.

In summary, I can have no preview with the custom form, or preview with the
regular form. This isn't ideal.

If there is a way round this, that'd be good.

Otherwise, do you think this behaviour is isolated to Outlook 2002? I'm
wondering if, when I distribute the pst file containing the post items
(which is a repository of archive information), I shall need to write a
program to edit the registry on user machines. I'd rather not. I'd prefer
an easier way forward.
That's exactly what you'd see if the item used the regular Post form.
That's the way it's designed to work.

I thought that must be the case.

If you have any further thoughts, they'd be very welcome.

Best regards
Geoff



Sue Mosher said:
After posting the Post Item, only the Subject and Bodytext fields appeared
in the Preview Pane. (It would be nice if the other fields appeared too,
but
it's not the end of the world because the custom fields can be still be
seen
in the list of Post Items above the Preview Pane.)

That's exactly what you'd see if the item used the regular Post form. That's
the way it's designed to work.
What's of more concern is that when I now open the custom Post Item, it
shows in the regular Post Item form. Also, if I then open the Edit menu
and
select Revise Contents, it remains in the regular Post Item form. This
means the user does not have access to the custom fields, should they need
to be revised.

When you designed the form, did you click the Edit Read Layout button and
create a read layout showing your custom fields?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

In summary, I can have no preview with the custom form, or preview with the
regular form. This isn't ideal.

That's all you get unless you move to Outlook 2007 or use a third-party tool (http://www.add-in-express.com/outlook-extension/).
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Geoff

Very many thanks for seeing me through this.

On reflection after my last post, I felt that the registry fix wasn't
appropriate. In effect, it seems the registry fix overrides the Post Item's
MessageClass property (if that has been set to display the Post Item in a
custom form) so that the Post Item displays in the regular form. The
(rhetorical) question then arises, why bother to set the MessageClass
property in the first place?

Many thanks for helping me see the trade-offs in Outlook 2002 and for the
tip about Outlook 2007.

Incidentally, your "Jumpstart" book has been a great help in the past. I
have long since adopted your convention of the "obj" prefix in all my Access
coding. It is so sensible from a number of points of view.

Many thanks again - over and out!
Best regards
Geoff




Sue Mosher said:
In summary, I can have no preview with the custom form, or preview with
the
regular form. This isn't ideal.

That's all you get unless you move to Outlook 2007 or use a third-party tool
(http://www.add-in-express.com/outlook-extension/).
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

I don't think the registry fix has anything to do with the message class. It just allows custom forms to show in the preview pane.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Geoff

I thought the behaviour I experienced (described in two posts back) seemed
to indicate that the registry fix did more than just allow the custom form
to display in the Preview Pane. When the registry fix was in place, the
Post Item that would otherwise display in the custom form did then display
in the Preview Pane, but it also reverted to opening in the regular Post
Item form (when it was opened) and, perhaps as might be expected, in the
regular Post Item form when then being revised. In other words, the
registry fix seemed to be having the effect of saying, if an item is
supposed to be opened and revised in the custom form, then override that
setting and preview, open and revise it in the regular form instead - ie the
registry fix does not just cause the Post Item to be displayed it in the
Preview Pane. I interpreted that as meaning that the registry fix was
overriding the MessageClass property since that property (as I understand
it) forces the Post Item to be opened and revised in the custom form. This
does seem odd because the registry fix implies it would only affect the
preview behaviour (since the new string value is in the Preview key).

In one sense, it doesn't matter too much because (as I understand it)
whichever route I take, I cannot get the behaviour I want from Outlook
2002 - which is to be able to preview, open and edit a Post Item using a
custom form.

Best regards
Geoff




I don't think the registry fix has anything to do with the message class. It
just allows custom forms to show in the preview pane.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top