none
Specify Controls in Selection in VSTO RRS feed

  • Question

  • I'm using Word Solution application-level project. It's possible to access Controls in a Document, But I need to access Controls in a user selection. Any thought?
    Wednesday, May 2, 2012 7:49 AM

Answers

  • Hi Mostapha

    Something like this:

    Globals.ThisAddin.Application.Selection.Range.ContentControls


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by Mostapha777 Saturday, May 5, 2012 9:54 AM
    Saturday, May 5, 2012 8:37 AM
    Moderator

All replies

  • Hi Mostapha

    I'm moving your question to the VSTO forum where you'll find more people working with the VSTO technology.

    But in order to answer your question we'll need more information:

    1. Version of Word and of VSTO involved?

    2. What kind of controls: Word content controls? Word ActiveX controls? VSTO controls placed on the document surface? Something else?


    Cindy Meister, VSTO/Word MVP

    Thursday, May 3, 2012 7:26 AM
    Moderator
  • Thanks Cindy. Sorry if my question was not clear.

    I'm using Office 2010 and VS 2010.

    I mean Word content controls such as  "Microsoft.Office.Tools.Word.RichTextContentControl" that are used in content of a Word document.


    Saturday, May 5, 2012 4:57 AM
  • Hi Mostapha

    Something like this:

    Globals.ThisAddin.Application.Selection.Range.ContentControls


    Cindy Meister, VSTO/Word MVP

    • Marked as answer by Mostapha777 Saturday, May 5, 2012 9:54 AM
    Saturday, May 5, 2012 8:37 AM
    Moderator