E
eselk
I have an OFT file and some code which runs from a COM add-in that
does:
1. CreateItemFromTemplete
2. Get FormDescription from the template item
3. Call PublishForm on the FormDescription, asking to publish to the
personal registry.
My code is in C++ and I use the COM objects directly at the IDispatch
level, so posting all of the code would be a mess.
PublishForm fails with error code 9 (deleted item). However, if I go
to Tools->Options->Other->Advanced, then just click the "Custom
Form..." button (I then cancel out of all screens, so I didn't make
any changes), the same code works.
My PublishForm code will also work if there is an item in the inbox
which uses that custom form (has that message class), but only if I
restart Outlook after the item is added... so I can't just fix the
issue by adding an item, then publishing my forms, because I'd have to
restart Outlook between the add and publish.
I'm able to recreate this problem on Outlook 2000 and 2003, both are
running on XP. I've recreated on 4 different PCs now.
I suspect Outlook loads something when I go into the custom forms
options, or open an item which uses custom forms, something which must
be loaded before PublishForm will succeed. Any ideas what that could
be, and how I can force Outlook to do that in my code?
does:
1. CreateItemFromTemplete
2. Get FormDescription from the template item
3. Call PublishForm on the FormDescription, asking to publish to the
personal registry.
My code is in C++ and I use the COM objects directly at the IDispatch
level, so posting all of the code would be a mess.
PublishForm fails with error code 9 (deleted item). However, if I go
to Tools->Options->Other->Advanced, then just click the "Custom
Form..." button (I then cancel out of all screens, so I didn't make
any changes), the same code works.
My PublishForm code will also work if there is an item in the inbox
which uses that custom form (has that message class), but only if I
restart Outlook after the item is added... so I can't just fix the
issue by adding an item, then publishing my forms, because I'd have to
restart Outlook between the add and publish.
I'm able to recreate this problem on Outlook 2000 and 2003, both are
running on XP. I've recreated on 4 different PCs now.
I suspect Outlook loads something when I go into the custom forms
options, or open an item which uses custom forms, something which must
be loaded before PublishForm will succeed. Any ideas what that could
be, and how I can force Outlook to do that in my code?