问题
I'm working on a MS Word AddIn (VSTO). The idea is that I work on a Word document and I send it somewhere.
I have all the code I need except one thing: is there a way I can get the filename of the Word document I'm working on? (assuming that is already saved)
回答1:
this.FullName property in the code-behind .cs file should give you the entire path of the current doc.
Here's the exact query in my QuickWatch window.
((Microsoft.Office.Tools.Word.Document)(this)).FullName
来源:https://stackoverflow.com/questions/792649/how-can-i-get-the-filename-of-a-word-document-from-c