none
How to find programatidcally when new word table is added to Word.Tables collection RRS feed

  • Question

  • We are linking tables and charts from excel file to word file.

    When I copy the table which is linked to excel file, within word field code information is getting lost.

    How can I maintain the field code information when linked table is copied within table.

    I was thinking to monitor this by subscribing the table added event .But there is no such event on WOrd.Tables collection..

    Will appreciate the help

    Thursday, March 29, 2012 8:34 AM

Answers

  • Hi Jay_OfficeIntegrator,

    Thanks for posting in the MSDN Forum.

    According to you description, I think application.DocumentChange event will fit your issue. Please try it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Bruce Song Tuesday, April 10, 2012 8:57 AM
    Monday, April 2, 2012 9:53 AM
    Moderator
  • Hi Jay,

    Tom has suggested an API for your requirement, however, it is kind of overkill.  As your noticed, the Word.Tables doesn't expose an event API for Tables. 

    You can combine the Application.DocumentChange event, and in event handler of this event, you query Word.Tables.Count, then you know when the tables are copied.

    best regards,


    Forrest Guo | MSDN Community Support | Feedback to manager

    • Marked as answer by Bruce Song Tuesday, April 10, 2012 8:57 AM
    Monday, April 9, 2012 9:23 AM
    Moderator

All replies

  • Hi Jay_OfficeIntegrator,

    Thanks for posting in the MSDN Forum.

    According to you description, I think application.DocumentChange event will fit your issue. Please try it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Bruce Song Tuesday, April 10, 2012 8:57 AM
    Monday, April 2, 2012 9:53 AM
    Moderator
  • Hi Jay,

    Tom has suggested an API for your requirement, however, it is kind of overkill.  As your noticed, the Word.Tables doesn't expose an event API for Tables. 

    You can combine the Application.DocumentChange event, and in event handler of this event, you query Word.Tables.Count, then you know when the tables are copied.

    best regards,


    Forrest Guo | MSDN Community Support | Feedback to manager

    • Marked as answer by Bruce Song Tuesday, April 10, 2012 8:57 AM
    Monday, April 9, 2012 9:23 AM
    Moderator
  • Hi Tom,Guo

    Thanks for the reply.

    I will try your suggestion.

    Friday, April 20, 2012 5:24 PM