none
Access Activeworkbook/ActivePresentation/ActiveDocument object using OpenXML RRS feed

  • Question

  • Hi,

    It is possible to access the active document in PowerPoint/Excel/Word and modify the components using OpenXML sdk?

    I mean by this, is there any way we can access or modify the newly opened (not saved in any location) document using OpenXML in PowerPOint,Excel or Word?
    Sayan Chatterjee | Senior Consultant | PricewaterhouseCoopers India
    Tuesday, January 5, 2010 10:50 AM

Answers

  • Hello Sayan,

    No. As far as I know, the OpenXML API is designed to create, modify documents at file stream level. So it is used to
    1. Generate new documents and write to local driver
    2. Read file from local driver, modify and write back.

    It cannot be used to modify the currently opened file in Office application. To achieve your objective, you should adopt the Office Automation or Office Addin via the COM interface. If you want to know more about the COM Addins, just let me know.


    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, January 6, 2010 8:42 AM
    Moderator

All replies

  • Hello Sayan,

    No. As far as I know, the OpenXML API is designed to create, modify documents at file stream level. So it is used to
    1. Generate new documents and write to local driver
    2. Read file from local driver, modify and write back.

    It cannot be used to modify the currently opened file in Office application. To achieve your objective, you should adopt the Office Automation or Office Addin via the COM interface. If you want to know more about the COM Addins, just let me know.


    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, January 6, 2010 8:42 AM
    Moderator
  • Hello Sayan,

    Is there any other help I can provide on this thread? If yes, just let me know.


    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, January 8, 2010 4:48 PM
    Moderator
  • Hi,

    Thanks for your reply. I can understand your point. It seems we have to use COM interface for manipulating active documents.
    Sayan Chatterjee | Senior Consultant | PricewaterhouseCoopers India
    Monday, January 11, 2010 12:12 PM