Retrieving file name and path from Office applications
-
In an add-in I made for office applications I was able to determine whether I'm working with WORD, EXCEL or POWERPOINT by using the GetIDsOfNames function on the application, while rgszNames = "Name". STDMETHOD ( GetIDsOfNames )( REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid ); While working with WORD I was able to retrieve the file name and path by further use of this function: The active document was retrieved by using the function on the application, while while rgszNames = "ActiveDocument". The document name was retrieved by using the function on the active document, while while rgszNames = "Name". The document's file path was retrieved by using the function on the active document, while while rgszNames = "Path". While working with EXCEL I was able to retrieve only the WorkBooks by using the function on the application, while while rgszNames = "WorkBooks". All this was done in the trial and error system. I'd appreciate it very much if someone could refer me to a list of values that can be sent as the rgszNames parameter and/or explain how to retrieve the file path and name while working with EXCEL and POWERPOINT. thanx :rose: