problem with publish custom Post form

S

shubhangi

hello
I've Customized IPM.POST form & need to publish it to folder when my
addin(VSTO SE ,OL 2007) starts (in Application_StartUp).When I run publish
code it always prompts for "Select Folder" though I've given the folder
object as an arg. to PublishForm().How to avoid the prompt for "Select
Folder"
I'm using below code

Dim olFormDesc As Outlook.FormDescription
Dim olPostItem As Outlook.PostItem
olPostItem = Application.CreateItemFromTemplate(AppPath & "\Case.oft")
olFormDesc = olPostItem.FormDescription
olFormDesc.Name = "Case"
olFormDesc.DisplayName = "Case"
olFormDesc.Hidden = False
olFormDesc.PublishForm(Outlook.OlFormRegistry.olFolderRegistry, ObjFolder)
olPostItem = Nothing
olFormDesc = Nothing

Thanks
 
S

shubhangi

I've one more question-
On my customized POST form(which has separate read,compose layout),I've the
message control.When I post the item ,on receiving & opening it I can't
change the contents of Message control.Is it bcoz the item is posted to
folder?Is it possible to allow the user to change the contents of message
control after posting it & opening it from the folder to which item was
posted?
thanks
 
K

Ken Slovak - [MVP - Outlook]

No post form can be changed once posted unless you use Edit, Revise
Contents. Doesn't that work for your custom post form?
 
S

shubhangi

Thanks !
1.with "Revise Contents" ,I'm able to change contents of Message ctrl on my
custom form.I need to allow the user to change contents of Message ctrl when
user opens the item.In such case I need to find "Revise Contents" by id &
use execute ,right?
2.I checked if the folder "ObjFolder" is set appropriately.Though
"ObjFolder" is set & it is not null ,still it prompts for select folder.The
folder is "Mail & Post Items" type.
thanks again
 
K

Ken Slovak - [MVP - Outlook]

1. Correct, get the control and call Execute on it. The ID for that control
as shown by OutlookSpy is 3273.

2. Your code isn't displaying the select folders dialog when you publish
your Post form, it's displaying that dialog when this line is executed:
olPostItem = Application.CreateItemFromTemplate(AppPath & "\Case.oft")

Supply the optional inFolder argument to the CreateItemFromTemplate() method
and that should get rid of that dialog. Continue to supply the folder
argument to the PublishForm() method line
 

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