index > Visual Studio Tools for Office > Dynamic XMLNode controls

Dynamic XMLNode controls

Hello,

I am interested by the ContextLeave/Enter events of VSTO XMLNode controls.

However, unlike bookmark controls, there does not seem to be a way to add XML Node controls dynamically.

If this is true, I will have to re-code the context enter/leave mechanism from the global XmlSelectionChanged event, comparing the path of the nodes in the DOM tree, and so on ... I am kind of lazy when it comes to something that I know already exists ;)

Does anyone know if there is any way to add XMLNode controls dynamically on top of existing Word XMLNodes ? If this is not possible, I would be curious to know the reason of this limitation.

Thanks


Cyril

Cyril Mathey
I think it is possible to do dynamic XMLNodes. You will need to construct the XPath that is passed in to initialize the XMLNode all by yourself though. Otherwise, you can pretty much use the syntax that is used by ThisDocument.Designer.cs when you add an XMLNode using the designer.


Misha (VSTO team is hiring. We would like to hear from you http://tinyurl.com/ZQGW2)
Misha Shneerson

misha,

in the designer.cs you have other code like:

public override void OnShutdown()
{
this.ImageCaptionNodes.Dispose();
this.ImagePathNodes.Dispose();

...

For all the starting parts I guess I can do it in InternalStartup in my partial c# class part.

For the Shutdown should I take care of it ?

Thanks for your help.




TechHeadBrothers - http://www.TechHeadBrothers.com
Laurent Kempé

The good practice is to dispose the view controls.

Although, in this particular case, disposing XMLNodes would not do much - I would recommend disposing the controls in ThisDocument_Shutdown anyway just to establish a habit.




Misha (VSTO team is hiring. We would like to hear from you http://tinyurl.com/ZQGW2)
Misha Shneerson
reply 4

You can use google to search for other answers

 

More Articles

• vsto contextmenu can't be closed automaticlly?
• Need help: What is session in microsoft outlook?
• Is it possible to implement this button?
• Excel object in shared com addin
• What are the difference between VSTO 2003 and VSTO 2005
• Outlook Add-in
• Word2007 Add-In: Can I customize the Word Options dialog ?
• Add a Slide Module to the VBE with VBA
• Outlook, custom action, and recurring appointments
• Creating Excel Workbooks - ISSUE
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• VSTO 2005 with German Office 2003 Instal
• How can I disable the menu shortcut keys
• Error on Visual Studio Tools for Office
• Word document Page count, word count, pa
• Password and CopyObject method to copy m
• How to: Interact with Windows Forms (C#
• What is good way for handling about .pst
• The customization does not have the requ
• Inserting hyperlink programmatically int
• Outlook Event (Flagicon changed)
• XML View and how to change reading pane
• Issue with Validation.Add
• C++ AddIns 4 MS-Word
• Background Thread Causing Flicker and Gr
• VS2005 Standard: What version of MS Offi

Hot Articles

• SpecialCells
• Iterating Outlook.ContactItem properties
• Delete a range in VSO
• Running Word Merge client side with a do
• NEWBIE question about Excel within VSTO
• Document Level Customization - Excel
• Migration of VBA code to VSTO
• IPropertySetStorage::Open() fails for so
• How do i implement Real-Time Comm. featu
• VSTO2005 performance
• VSTO installation
• Updating the add-in without RE-install ..
• Microsoft Word 2003 and WordML (How to S
• COMException, when I try to add controls
• Expansion Pack can not find Smart Doc Pr

Recommend Articles

• Binding a 2D array to a ListObject contr
• Deploying Excel Smart Doc Solution to Wi
• How to Associate Custom Data with XMLNod
• protection
• C# with Excel -- How to select a sheet?
• Trying to force installer to use VSTOR.e
• Issue with the menu "Microsoft Offi
• Writing Complex Macro or VBA Code?
• Copy Excel Sheet from one Workbook to Ot
• ListObject and Range Relation
• Developing Add-in for Office XP: Open Is
• Embedding Images in Outlook emails
• Merged Word Menus are not accessible aft
• Mapping CustomXML data into ContentContr
• Saving Word Documents without Actions Pa