VSTO Outlook Addin with a winform
-
I may be asking this question in the wrong forum. I have created an Outlook Addin using VSTO 2005. I created a simple winform and added it to my project. The winform is just to collect 3 parameers from the user. When I execute the addin in debug, it works. When I build it and deploy it using the setup project the button that create is added to the tool bar but when clicked it does not disply my winform screen. Any help would be greatly appreciated. Thanks, Patrick
-
I may be asking this question in the wrong forum. I have created an Outlook Addin using VSTO 2005. I created a simple winform and added it to my project. The winform is just to collect 3 parameers from the user. When I execute the addin in debug, it works. When I build it and deploy it using the setup project the button that create is added to the tool bar but when clicked it does not disply my winform screen. Any help would be greatly appreciated. Thanks, Patrick
Hi Patrick, Try setting caspol on the machine you install to so your VSTO dlls have full trust permission. If they don't that will prevent them running. This is automatically set on development machines. VSTO by default suppresses error messages (though there is a setting you can type at the command line to change that - you'll have to google it, something like VSTOSUPPRESSERRORS = false, though that's wrong) so it's hard to tell what's going on - you can always put try{}catches{} around your code then display a message box or log to the event log, but often if something just doesn't happen it is a caspol issue due to the security model of the VSTO architecture. If you have any further questions please ask away. Regards, Toby Toby
-
Hi Patrick, Try setting caspol on the machine you install to so your VSTO dlls have full trust permission. If they don't that will prevent them running. This is automatically set on development machines. VSTO by default suppresses error messages (though there is a setting you can type at the command line to change that - you'll have to google it, something like VSTOSUPPRESSERRORS = false, though that's wrong) so it's hard to tell what's going on - you can always put try{}catches{} around your code then display a message box or log to the event log, but often if something just doesn't happen it is a caspol issue due to the security model of the VSTO architecture. If you have any further questions please ask away. Regards, Toby Toby
Hi Toby, At first I had several security problems but I was able to resolve them by adding some custom installer actions to set the user's pc security policy as directed by these two articles on msdn. http://msdn2.microsoft.com/en-us/library/bb332051.aspx[^] http://msdn2.microsoft.com/en-us/library/bb332052.aspx[^] Then when I added the following line of code. parmFormResult = exportParameterForm.ShowDialog(); At that point in time it will not execute my new code. The exportParmaeterForm object is a winform object not an outlook form. When I comment out the line of code the addin will execute on the user's PC. Does and addin have the capability to call a winform object? Thanks, Patrick
-
Hi Toby, At first I had several security problems but I was able to resolve them by adding some custom installer actions to set the user's pc security policy as directed by these two articles on msdn. http://msdn2.microsoft.com/en-us/library/bb332051.aspx[^] http://msdn2.microsoft.com/en-us/library/bb332052.aspx[^] Then when I added the following line of code. parmFormResult = exportParameterForm.ShowDialog(); At that point in time it will not execute my new code. The exportParmaeterForm object is a winform object not an outlook form. When I comment out the line of code the addin will execute on the user's PC. Does and addin have the capability to call a winform object? Thanks, Patrick
Hi Patrick, I certainly show Winforms modally using .ShowDialog() from VSTO addins, but I haven't done it from Outlook - only Word, Excel and Powerpoint. Also I'm using VSTO v3 and Office 2007; I'm not sure what version you're using, but VSTO can be quite different between releases. What's happening when you run it in debug and put a breakpoint there? You really need to know what the exception being thrown is so try to trap the error so you can read it. Cheers, Toby Toby -- modified at 20:27 Wednesday 8th August, 2007
-
Hi Patrick, I certainly show Winforms modally using .ShowDialog() from VSTO addins, but I haven't done it from Outlook - only Word, Excel and Powerpoint. Also I'm using VSTO v3 and Office 2007; I'm not sure what version you're using, but VSTO can be quite different between releases. What's happening when you run it in debug and put a breakpoint there? You really need to know what the exception being thrown is so try to trap the error so you can read it. Cheers, Toby Toby -- modified at 20:27 Wednesday 8th August, 2007
Toby, I am using the defualt install that comes with Visual Studio 2005 Team Edition. Also, I am using Outlook 2003. When I do help | about this is what is displayed: Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200) Microsoft .NET Framework Version 2.0.50727 Installed Edition: Enterprise Microsoft Visual Studio Tools for Office Microsoft Visual Studio Tools for the Microsoft Office System ------------------------------------ How else can I find the exact version of VSTO? When I run the addin in debug mode it does work. I am going to put more try/catches in to capture the error. Thanks for your help and advice. Patrick
-
Toby, I am using the defualt install that comes with Visual Studio 2005 Team Edition. Also, I am using Outlook 2003. When I do help | about this is what is displayed: Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200) Microsoft .NET Framework Version 2.0.50727 Installed Edition: Enterprise Microsoft Visual Studio Tools for Office Microsoft Visual Studio Tools for the Microsoft Office System ------------------------------------ How else can I find the exact version of VSTO? When I run the addin in debug mode it does work. I am going to put more try/catches in to capture the error. Thanks for your help and advice. Patrick
Patrick, From that list I would say you don't have the VSTO SE (v3) installed as it tells you it is VSTO SE. The project types change with each release, as do the capabilities. I am currently using purely VSTO v3 with Office 2007 so my experience with it will differ from your's. I do, however, remember using VSTO 2005 (the 2nd release) with Word 2003 when VS2005 was first released and don't think I had any trouble with Windows Forms then either... Outlook is different from Word in many regards though. I suggest you try the MSDN VSTO Forums, you'll usually find you receive answers there, generally from MVPs, quite quickly. Try http://forums.microsoft.com/msdn/showforum.aspx?forumid=16&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=0[^]
-
Patrick, From that list I would say you don't have the VSTO SE (v3) installed as it tells you it is VSTO SE. The project types change with each release, as do the capabilities. I am currently using purely VSTO v3 with Office 2007 so my experience with it will differ from your's. I do, however, remember using VSTO 2005 (the 2nd release) with Word 2003 when VS2005 was first released and don't think I had any trouble with Windows Forms then either... Outlook is different from Word in many regards though. I suggest you try the MSDN VSTO Forums, you'll usually find you receive answers there, generally from MVPs, quite quickly. Try http://forums.microsoft.com/msdn/showforum.aspx?forumid=16&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=0[^]
Toby, The problem was that I was not granting full trust to my logging dll used to write a text log file. I had given the primary addin assembly full trust but my setup project did not grant full trust to the logging assembly. So the setup utility was changed to grant full trust to all assemblies that reside in it. This is an acceptable solution as long as the assembly is used with in my company. If I was working for a company that sold software, it would be best to grant the individual assemblies full trust since I would loose control of what is placed in the application folder. A nice support person from MS Support showed me why it was not working. Thanks for all your help and taking the time to reply to my post. Patrick