MSDN > フォーラム ホーム > Visual Studio Tools for Office > How to find controls in customized document and delete them
質問する質問する
 

回答済みHow to find controls in customized document and delete them

  • 2009年7月4日 21:43Stanislav Kroschenko ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hello

    I would like to customize my document and i need to find combobox controls, check if property Text is empty or not, and if empty delete this whole line on which control is.

    I think that i need loop through all controls, check if it is control which i need, and then check text property.
    However i can't get Name property of control and i don't know how to delete whole line with my controle.

    Please help, thanks in advance

回答

すべての返信

  • 2009年7月6日 8:35Cindy MeisterMVP, モデレータユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi Stanislav

    Which application (Word, something else)?

    Which version of the application?

    What kind of combobox controls? (If you don't know, describe the exact steps used to create them in the document.)

    Office documents can, depending on the parent application, host many different types (technologies) of controls. Before we can tell you what you need in the object model we require this additional information.
    Cindy Meister, VSTO/Word MVP
  • 2009年7月7日 23:34Stanislav Kroschenko ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi Cindy

    I'm customizing a document of Word 2007 application with VSTO 3.0.
    I am using the latest kind of combobox from this class Microsoft.Office.Tools.Word.ComboBoxContentControl.

    Thanks

  • 2009年7月8日 8:15Cindy MeisterMVP, モデレータユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済み
    Hi Stanislav

    Thank you for the additional information :-)

    If the controls have been placed in the document at design time, then they cannot be deleted at run-time. Only controls inserted at run-time can be deleted from a document. The discussion in this MSDN article may be of some assistance.
    Cindy Meister, VSTO/Word MVP
  • 2009年7月8日 17:17Stanislav Kroschenko ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Thanks, this article really helped me.