Fatih Karameşe
Fatih Karameşe

Reputation: 1

Is there any way to get files Id in OfficeJS

I am using Graph API's recently and there is an API get files content by id. Is there any way to get document id so I can call Graph API and get its content ?

Excel.run(function(context) {
    var workbookId = context.workbook.id;
    return context.sync()
        .then(function() {
            console.log("Workbook ID: " + workbookId);
        });
}).catch(function(error) {
    console.log("Error: " + error);
});

I tried this code but it always says undefined

Upvotes: 0

Views: 107

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49397

The Excel.Workbook class doesn't provide the Id property. But you may find the Id property for the Excel.Worksheet class.

Use the name property instead in case of workbooks.

Upvotes: 0

Related Questions