Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Retrieving file name and path from Office applications

Retrieving file name and path from Office applications

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 359850
    wrote on last edited by
    #1

    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:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups