Evault custom form & preview pane code

K

kristan.mcdonald

Hi all,

I'm trying to write a custom form which allows users to perform some
tasks before sending. My problem is however that because the form does
stuff on startup, recipients get the preview pane active scripting
error.

We however also have Evault which replaces old email items with a
custom form (IPM.Note.EnterpriseVault.Shortcut) which has loads of vb
code inside, however shows in the preview pane fine and when you open
it, runs code to pull an existing email from the vault and displays it
as a normal outlook item.

I'm trying to figure out how they've got it to run code when opening
the email message, but outlook doesn't complain when previewing the
item. Any ideas as I'm stumped and really need a solution!

Thanks,

Kristan
 
E

Eric Legault [MVP - Outlook]

Are you certain there's code in that custom form, and not an Add-In that's
doing something? AFAIK, it's impossible to use the preview pane if there's
ANY code behind a custom form.

BTW, there's a microsoft.public.outlook.program_forms newsgroup specific to
forms questions.
 
K

kristan.mcdonald

There is indeed code in the custom form, if I copy the code out and
paste it into a new form based on IPM.Note it gives the active
scripting message in the preview pane.

Basically Enterprise vault works by trawling your mailbox, deleting
IPM.Note items and replacing them with
IPM.Note.EnterpriseVault.Shortcut items with the body as an HTML
message which consists of the first few lines of the original email and
any attachments as hyperlinks. When you open this item (doubleclick) it
triggers an addin to load the actual message from the vault. Without
the adding all it does it load the message the normal way and says the
original couldn't be retreived from the vault, so the addin doesn't
affect the preview pane behaviour. It's all very clever, but what I
really need to know is how it manages make the preview pane think it's
a normal email. I've had outlook spy on to compare my messages vs
evault items and there are differences but it's things like subject
etc.

I wasn't sure if it was a vba or form question tbh, I didn't want to
cross post but I'll try there if no-one here can help.
 
E

Eric Legault [MVP - Outlook]

Fellow MVP Dmitry Streblechenko knows the trick behind this:

"It is a bit in a property (internally called SideEffects) that indicates
that the message has active content:

{00062008-0000-0000-C000-000000000046}, 0x8510, PT_LONG

The bit is 0x2000. Set that bit on a regular message – no preview pane.
Remove that bit from a message that has a one-off form and a script – Outlook
will happily display its contents in the preview pane."

So if you're comfortable using CDO (or Redemption from
http://www.dimastr.com), give it a shot.
 

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