How to find controls in customized document and delete themHello<br/><br/>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.<br/><br/>I think that i need loop through all controls, check if it is control which i need, and then check text property.<br/>However i can't get Name property of control and i don't know how to delete whole line with my controle.<br/><br/>Please help, thanks in advance© 2009 Microsoft Corporation. All rights reserved.Wed, 08 Jul 2009 18:36:30 Z53528303-b145-47a7-9160-dad12bafa38fhttp://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#53528303-b145-47a7-9160-dad12bafa38fhttp://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#53528303-b145-47a7-9160-dad12bafa38fStanislav Kroschenkohttp://social.msdn.microsoft.com/Profile/en-US/?user=Stanislav%20KroschenkoHow to find controls in customized document and delete themHello<br/><br/>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.<br/><br/>I think that i need loop through all controls, check if it is control which i need, and then check text property.<br/>However i can't get Name property of control and i don't know how to delete whole line with my controle.<br/><br/>Please help, thanks in advanceSat, 04 Jul 2009 21:43:30 Z2009-07-04T21:43:30Zhttp://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#c4e27ac4-e5d7-4c8d-b11e-ce86bee940cchttp://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#c4e27ac4-e5d7-4c8d-b11e-ce86bee940ccCindy Meisterhttp://social.msdn.microsoft.com/Profile/en-US/?user=Cindy%20MeisterHow to find controls in customized document and delete themHi Stanislav<br/><br/>Which application (Word, something else)? <br/><br/>Which version of the application? <br/><br/>What kind of combobox controls? (If you don't know, describe the exact steps used to create them in the document.)<br/><br/>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.<hr class="sig">Cindy Meister, VSTO/Word MVPMon, 06 Jul 2009 08:35:43 Z2009-07-06T08:35:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#acbfd74f-6d43-475d-bc5e-a06eff9508b9http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#acbfd74f-6d43-475d-bc5e-a06eff9508b9Stanislav Kroschenkohttp://social.msdn.microsoft.com/Profile/en-US/?user=Stanislav%20KroschenkoHow to find controls in customized document and delete them<div>Hi Cindy</div> <div><br/></div> <div>I'm customizing a document of Word 2007 application with VSTO 3.0.</div> <div>I am using the latest kind of combobox from this class Microsoft.Office.Tools.Word.ComboBoxContentControl.</div> <div><br/></div> <div>Thanks</div> <div><br/></div>Tue, 07 Jul 2009 23:34:28 Z2009-07-07T23:34:28Zhttp://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#7cea54c4-40c1-4ec5-8713-333bf410e584http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#7cea54c4-40c1-4ec5-8713-333bf410e584Cindy Meisterhttp://social.msdn.microsoft.com/Profile/en-US/?user=Cindy%20MeisterHow to find controls in customized document and delete themHi Stanislav<br/><br/>Thank you for the additional information :-)<br/><br/>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 <a href="http://msdn.microsoft.com/en-us/library/x97a5x3s.aspx">this MSDN article</a> may be of some assistance.<hr class="sig">Cindy Meister, VSTO/Word MVPWed, 08 Jul 2009 08:15:58 Z2009-07-08T08:15:58Zhttp://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#32955b23-fa14-484c-8e19-e2f9c55866b8http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/53528303-b145-47a7-9160-dad12bafa38f#32955b23-fa14-484c-8e19-e2f9c55866b8Stanislav Kroschenkohttp://social.msdn.microsoft.com/Profile/en-US/?user=Stanislav%20KroschenkoHow to find controls in customized document and delete them<span style="font-family:'Times New Roman';font-size:16px"> <div style="font:normal normal normal small/normal arial;margin:8px"><span style="font-family:'Times New Roman';font-size:16px"> <div style="color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:#ffffff;margin:8px">Thanks, this article really helped me.</div> </span></div> </span>Wed, 08 Jul 2009 17:17:29 Z2009-07-08T17:17:29Z