radiorus

Hi,
I have problem :

I create complex content control (from several content controls and other text and table elements then group all this components) then I hooking ContentControlOnEnter event .
All good. But some times after editing text or clicking on other controls - event(ContentControlOnEnter ) not sended any more
// some code
object zero = 0;
Range range = app.ActiveDocument.Range(ref zero, ref zero);
Table table = app.ActiveDocument.Tables.Add(range, 2, 1, ref WordUtils.OBJ, ref WordUtils.OBJ);

table.Borders.Enable = 1;

table.Borders.OutsideColor = color;
table.Borders.InsideColor = color;

table.Rows[1].Range.HighlightColorIndex = WdColorIndex.wdGray25;
app.Selection.TypeText(title);

table.Rows[2].Height = 500;

ContentControl control1 = app.ActiveDocument.ContentControls.Add(WdContentControlType.wdContentControlText, ref WordUtils.OBJ);

WordUtils.MoveDown(app);
ContentControl control2 = app.ActiveDocument.ContentControls.Add(WdContentControlType.wdContentControlBuildingBlockGallery, ref WordUtils.OBJ);
/////////////////////////////////////////////////////////////////////
app.ActiveDocument.ContentControlOnEnter += new DocumentEvents2_ContentControlOnEnterEventHandler(ActiveDocument_ContentControlOnEnter);



Re: Visual Studio Tools for Office ContentControlOnEnter

radiorus

I have 2 content controls and I select first then select second (select- click on it) after 3-5 cycles event not sended any more!!!





Re: Visual Studio Tools for Office ContentControlOnEnter

radiorus

I already resolve this problem !
Need save link to app.ActiveDocument .