problem with Form region (.ofs) import in VSTO 2007
- We are developing Outlook application using VSTO 2007, and since we want to customize the reading pane for certain message class, so we are Creating the replacement form region, to get the same user interface as of outlook in reading pane. we are designing the form region from outlook as .ofs file and then trying to import it in VSTO 2007, but it is continuously giving error of.
"Object reference not set to an instance of an object."
We also google alot and dont find any resolution. Also checked the objects in ofs for blank property but it is not there as suggested in http://social.msdn.microsoft.com/forums/en-US/vsto/thread/f344b016-c471-4fe1-9371-8a100d6edd5a/ but it also doesnt work.
Does there any way to varify what the issue it is getting while importing the ofs file.
Answers
- Hello,
I have had this happen to me in the past as well. Try the following:
1. Close any instances of Outlook that you have running on your development machine.
2. Open the task manager and ensure that the OUTLOOK.EXE process is not running. If it is, end the process.
3. Attempt to import the .OFS file again.
Norm E.
Norm Estabrook- Marked As Answer byvijay kumar anand Saturday, October 31, 2009 10:19 AM
Hmm. I am not sure how to prevent a form region from appearing under the Action menu. Perhaps someone else monitoring this thread could speak to that task.
As far as updating an imported form region, I believe the supported way of doing this is to back your code up, make changes to the form region in Outlook (adding / removing controls etc), and then re-import the form region again. Here is an excerpt taken from the MSDN topic "Creating Outlook Form Regions" at - http://msdn.microsoft.com/en-us/library/bb386301.aspx:Updating an Imported Form Region's Design
You can add, remove, or change controls on the form region. Before you do this, back up any code that you added to the form region code file. Then, open the .ofs file in Outlook, modify the form region, and then save the changes. Use the New Outlook Form Region wizard to import the modified .ofs file. You can then paste your code into the new form region code file.
Norm Estabrook- Marked As Answer byvijay kumar anand Thursday, November 05, 2009 8:59 AM
All Replies
- Hello,
I have had this happen to me in the past as well. Try the following:
1. Close any instances of Outlook that you have running on your development machine.
2. Open the task manager and ensure that the OUTLOOK.EXE process is not running. If it is, end the process.
3. Attempt to import the .OFS file again.
Norm E.
Norm Estabrook- Marked As Answer byvijay kumar anand Saturday, October 31, 2009 10:19 AM
- Hi Norm,
it works. Thanks a lot.
but the form region i had added, showing under Action menu, can we restrict our form region to not add there, also if i need to make some minor change in form region, can we updated our added form region without removing and readding the formregion again to project Hmm. I am not sure how to prevent a form region from appearing under the Action menu. Perhaps someone else monitoring this thread could speak to that task.
As far as updating an imported form region, I believe the supported way of doing this is to back your code up, make changes to the form region in Outlook (adding / removing controls etc), and then re-import the form region again. Here is an excerpt taken from the MSDN topic "Creating Outlook Form Regions" at - http://msdn.microsoft.com/en-us/library/bb386301.aspx:Updating an Imported Form Region's Design
You can add, remove, or change controls on the form region. Before you do this, back up any code that you added to the form region code file. Then, open the .ofs file in Outlook, modify the form region, and then save the changes. Use the New Outlook Form Region wizard to import the modified .ofs file. You can then paste your code into the new form region code file.
Norm Estabrook- Marked As Answer byvijay kumar anand Thursday, November 05, 2009 8:59 AM
- Thankx Norm for your help.


