Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Office.FileProperties interface
- Package:
- office
Remarks
Used by
Examples
// To read the URL of the current file, you need to write a callback function that returns the URL.
// The following example shows how to:
// 1. Pass an anonymous callback function that returns the value of the file's URL
// to the callback parameter of the getFilePropertiesAsync method.
// 2. Display the value on the add-in's page.
function getFileUrl() {
// Get the URL of the current file.
Office.context.document.getFilePropertiesAsync(function (asyncResult) {
const fileProperties: Office.FileProperties = asyncResult.value;
const fileUrl = fileProperties.url;
if (fileUrl === "") {
showMessage("The file hasn't been saved yet. Save the file and try again");
} else {
showMessage(fileUrl);
}
});
}
Properties
| url | File's URL |
Property Details
url
File's URL
url: string
Property Value
string
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
