How to get path of launching/opening document from Recent tab in Microsoft Word using vb.net

Ruby Sharma 1 Reputation point
2022-09-02T05:27:34.717+00:00

We have designed Microsoft Addins for MS Word 2019. Now I need path of current document that is been launching, for this we have used a code statement "Globals.Connect.Application.ActiveDocument.FullName" that fetches active document path. But when we launch a second document in parallel keeping first document opened, it shows path of first document .
So can you assist on this issue.

Here are some more information about on which environment I'm working :

Operating System : Microsoft Windows 10 Pro
Code Editor : Visual Studio 2019
Technology : Vb.net(.Net Framework 4.8)
MS Word Version : 2019(32 bit)

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,450 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 111.5K Reputation points
    2022-09-02T18:51:42.757+00:00

    Maybe your Addin should handle the Application.DocumentOpen event. It will receive a Document object, which will offer the path (after the document is opened).

    1 person found this answer helpful.