Word does not aswer to any Add-in
Hi,
I am newbie and i realy need help with my three questions i have worked on them 2 weeks but not success.
1. I built a shared Add-In project that worked good on ms word but i dont now what i have changed, now after many times debugging ms word does not answer any more to any add-in projects, I tryed to debugg my code i set "start external program" to Word.exe and used break points but my breakpoints dont work and 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 the active 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";
}
}
|