Search code examples
c#visual-studiovs-extensibilityvspackage

Get file path from Visual Studio editor


I'm developing a Visual Studio Package, written in C#.

How do I get the full path of the active editor programatically?


Solution

  • When working macros you can use

    DTE.ActiveDocument.Path + DTE.ActiveDocument.Name
    

    to get the full path. Likely this is the same in C# when making VS packages?