insert text to active cell by shared add-in
Hi,
I have three question:
1. I built a shared Add-In project that worked good on ms word but i dont know what i have changed, now after many times debugging ms word does not answer to any add-in project at all , I tryed to debugg my code i set "start external program" to Word.exe and used br
eak points but i got message like
"the breakpoint will not currently be hit no symbols have been loaded for this document".
2. how can i insert a text as a custom property to word document?
3. i have built another add-in for Excel it works but i can not insert text to activeCell, I can see my toolbar and my button but it can not insert text.
here is a litle bit of my code:
Excel.Application excelApp = null;
public void OnConnection(object application, Extensibility.ext_ConnectMode c
onnectMode, object addInInst, ref System.Array custom)
{
excelApp = (Excel.Application)application;
insertText = MakeANewButton(toolBar, "Insert text", 1044, new _CommandBarB
uttonEvents_ClickEventHandler(insertText
_Click));
}
private CommandBarButton MakeANewButton(CommandBar commandBar, string captio
n, int faceID, _CommandBarButtonEvents_ClickEventHandle
r clickHandler)
{
object missing = System.Reflection.Missing.Value;
try
{
Microsoft.Office.Core.CommandBarButton newButton;
newButton = (CommandBarButton)commandBar.Controls.Add(MsoContr olType
.msoControlButton, missing, missing, missing, missing);
newButton.Caption = caption;
newButton.FaceId = faceID;
newButton.Click += clickHandler;
return newButton;
}
catch
{
return null;
}
}
public void insertText_Click(CommandBarButton barButton, ref bool someBool)
{
if (excelApp != null)
{
this.excelApp.ActiveCell.Value2 = "someText";
}
}
|