Neil Weber

We use Word to edit XML. Our users forget to tell Word to show XML tags in the document. I know the checkbox is located in the XML Structure task pane. What I want to do is duplicate that checkbox in my document action pane. Is there a way of programmatically enabling it via VSTO Is there a some type of event fired when the option or property is changed (so I can keep the checkbox in synch with the actual setting).

Thanks,

Neil



Re: Visual Studio Tools for Office Programmatically Showing XML Tags

Cindy Meister

Hi Neil

The first part can be done. I'm not sitting at box with Office installed at the moment, but record a macro in Word and toggle the option. You should get the syntax in the recorded macro (you will for sure if this is 2003 - based on your problem description I'm guessing this is this a 2003 document-level customization).

For the second part, I don't think there is any kind of event. Word doesn't provide a lot of events. If you were willing to put a VBA procedure in the document you could trap it. Or if this were 2007 it would be possible to re-route the command over the Ribbon XML.






Re: Visual Studio Tools for Office Programmatically Showing XML Tags

Neil Weber

Ugh, I forgot about the record a macro trick. Thanks. BTW, it's ActiveWindow.View.ShowXMLMarkup.