KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to develop a VSTO 2010 Word Addin. It has a custom task pane with a countdown timer (user control) in it. Idea is that when a word document is opened total time (in hours and minutes) is passed to the Addin which in turn passes it to the countdown timer control. When i run the addin in VS2010 and pass the user control two integers values i.e. hours and minutes in the Addin_Startup it works fine. Now i am trying to open a word document on button click from an asp.net page. When i click the button a word document should open and time in hours and minutes should be passed to the addin which will then give it to the user control and the timer should run for the given time. Problem is i cant figure out how to pass two integers to the addin and where to pass them. Following is my code which sometimes give "Catastrophic failure error" and other times it gives me "Unable to cast COM object of type 'System.__ComObject' to interface type 'MyWordAddin.IAddInUtilities'" ThisAddin Class namespace MyWordAddin { public partial class ThisAddIn { private ctlClock myUserControl; private Microsoft.Office.Tools.CustomTaskPane myCustomTaskPane; private int hour, min; private AddInUtilities utilities; protected override object RequestComAddInAutomationService() { if (utilities == null) { utilities = new AddInUtilities(); } return utilities; } public int Min { get { return min; } set { min = value; } } public int Hour { get { return hour; } set { hour = value; } } public Microsoft.Office.Tools.CustomTaskPane MyCustomTaskPane { get { return myCustomTaskPane; } set { myCustomTaskPane = value; } } public void ThisAddIn_Startup(object sender, System.EventArg
Tags (comma-separated)
Save Edits
Cancel