none
Can we Cache Mapped xml nodes in vsto RRS feed

  • Question

  •  

    Hi all,

              i am totally new to vsto so, as of now i am designing the a template using vsto which consists of testcases in the form of xmlnodes i need to perform add test case,delete testcase and reorder it so for adding as there is no dynamic mapping in word2003(i think). i doing copying of certain node and pasting it. using range object for pasting.

            so i thought if caching can be done i can write some nodes into cache and i can copy and paste it from the cache

    is this can be done in vsto using word2003..

    please help me out...with also reodering mapped nodes and deleting them.. and i also want to know whether the cursor is in certain node or not and based on cursor positions i need to trigger certain events.

    can you please kindly help me on this..

    i am using word 2003..

     

    thanks and regards,

    aravind

                                                

    Friday, December 14, 2007 9:39 AM

Answers

  • I'm afraid the Word application simply doesn't provide any "caching" capabilities the way a .NET developer means it. At best, Word can "cache" formatted text, or plain text. That's it. Or you'd have to open an additional, temporary (invisible?) document to store things until you need them again.

     

    I don't know the answer to your second question, and since you've posted it as a separate question (always the best thing, when something is unrelated to the main thread), best to follow it there. Certainly, you can write the information to a ContentControl. (I'm assuming that's what you mean by a "custom field".)

    Monday, December 17, 2007 4:07 PM
    Moderator

All replies

  • Hi Aravind

     

    I'm not certain I understand all your requirements, but let's see if I can help with at least a part...

     

    Word has no "cache" you can use to temporarily store things. However, it seems to me that, since you're using a template, AutoText might serve your needs. To test this, start Word as a normal end user. Save a new document as a template.

     

    Attach an XML schema to it (Tools/Templates and Add-ins/XML Schemas) to provide some nodes. Use the XML Structures Task Pane (View/Toolbars) to access the XML provided by the schema and insert some nodes into the document. (Note: these nodes are the basis that VSTO uses, but they don't provide exactly the same functionality outside of VSTO.)

     

    Now select one of the nodes as you'd like to cache. Insert/AutoText/AutoText. Make sure you're saving in the template you're working in. Type in a (short) name; click the ADD button. Close the dialog box. Repeat this a couple of times so that you have a selection.

     

    Now, when you type the short name, or when you look in the Insert/AutoText listings, you should be able to easily insert the entry you require. I think this approach would be better than copying and pasting. It may need some refinement, here and there...
    Friday, December 14, 2007 2:24 PM
    Moderator
  • hi cindy,

     

    ya it works but i need to insert set of nodes on some event and these set of nodes must also validate my schema.. so it will be more helpfull if i store these set of nodes somewhere can this be done..

     

     

    and  also one new question please.. on laod of a vsto application i want to write the assembly version no of the assembly which the application is using to custom field.. is this possible to write dll version number to custom field.. i am going to put dll in the gac..

     

    thanks and regards,

    aravind

                                      

    Monday, December 17, 2007 10:16 AM
  • I'm afraid the Word application simply doesn't provide any "caching" capabilities the way a .NET developer means it. At best, Word can "cache" formatted text, or plain text. That's it. Or you'd have to open an additional, temporary (invisible?) document to store things until you need them again.

     

    I don't know the answer to your second question, and since you've posted it as a separate question (always the best thing, when something is unrelated to the main thread), best to follow it there. Certainly, you can write the information to a ContentControl. (I'm assuming that's what you mean by a "custom field".)

    Monday, December 17, 2007 4:07 PM
    Moderator
  • ya sure custom control itself.

    thanks and regards,

    aravind

    Tuesday, December 18, 2007 5:19 AM