Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the path to the current file in a Shared COM Office Add-in?

I am wondering how I can get the path to the current file that is open in a Shared COM Add-in for Microsoft Office. I am using Visual Studio 2010 with C#

I know this question has been asked, "How do I get the file in an Excel add-in?" but that does not answer my question.

like image 355
Joe the Person Avatar asked Nov 13 '22 21:11

Joe the Person


1 Answers

Actually this is the correct way to do it:

this.Application.ActiveDocument.Name

and

this.Application.ActiveDocument.Path

like image 77
Joe the Person Avatar answered Dec 25 '22 14:12

Joe the Person