![]() |
Outlook Addin CommandBarButton Click Event Not Firing
Hi guys,
I am trying to get my VSTO 2005 Addin to deploy to a test client machine. The addin works fine on my development machine and is as simple as a custom CommandBarButton on an appointment form that opens a .NET windows form that users are required to fill out after creating each appointment. I have done the following to get the addin to install sucessfully on the client machine: - Installed WinXP and Windows Updated it as of 16th Jan 2006 - Installed Office 2003 SP2 - Added the PIA and VSTO Runtime as prerequisites to my addin install application. - Added necessary Code Access Security modifications to trust my application implicitly. - Installed the addin on the test client machine. The addin installs fine and my buttons appear on the appointment items. However, when run on the test client machine the button click events do not fire at all. I have stuck some messagebox.show's as the first line in the event handlers to ensure that it wasn't the child form failing without bubbling the error up, but the messagebox does not get shown. I have included my code that creates and handles the button and it's click event for reference. I am completely stuck with this and so far my research is telling me that I am the only person to get this behaviour :(:( In the outlookInspectors_NewInspector(Microsoft.Office.In terop.Outlook.Inspector Inspector) event, I create my command bar button... // Add the Edit Timesheet Information button. _mailButton = (Office.CommandBarButton)_shortcutBar.Controls.Add (Office.MsoControlType.msoControlButton, missing, missing, 1, 1); _mailButton.Style = Office.MsoButtonStyle.msoButtonIconAndCaption; _mailButton.Caption = "Edit Timesheet Information"; _mailButton.FaceId = 1106; _mailButton.TooltipText = "Click here to display this appointment with all timesheet information."; _mailButton.Click += new Office._CommandBarButtonEvents_ClickEventHandler(O nNewMailButtonClick); _mailButton.Tag = new Guid().ToString(); My event handler then looks like this... private void OnNewMailButtonClick(Office.CommandBarButton Ctrl, ref bool CancelDefault) { try { MessageBox.Show("OnNewMailButtonClick fired"); } catch (Exception ex) { MessageBox.Show("An error occured loading the Job information screen: " + ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } -- Cheers, Stu |
All times are GMT +1. The time now is 05:32 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com