Office 2013 apps: How to get the name of the file using Office 2013 Javascript API

1.1k Views Asked by At

I am creating a Office Task Pane app and running it using MS Word 2013. As i run the app it opened a task pane in Word with a document named "Document1.docx". How can i get this file name "Document1.docx" using Office 2013 Javascript API? If this is not achieve by Office Javascript API, is there any other technique to achieve this with in a Office 2013 task pane app for word?

1

There are 1 best solutions below

0
On

I found solution of this problem here.
http://social.msdn.microsoft.com/Forums/en-US/appsforoffice/thread/2cf80790-7088-4568-813b-7b645a8ebd2e?prof=required

You can use the Javascript API and get the Office.context.document.url property, but this comes with caveats - see the link for more details.