Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving/retrieving file in ProgramData folder using OfficeJS

Tags:

office-js

I am new in "Apps for Office" development. I am using task pane in my add-in. From my add-in I am trying to save some file to "C:\ProgramData" folder. In VSTO I can easily access local folders using C# code and save file there:

SpecialFolder.CommonApplicationData

Is there any way to have the local file access using OfficeJS and save a file there? My point is that as OfficeJs using word context and word can save file anywhere my local pc, so there may be a way of saving file in local PC programmatically.

I have checked the OfficeJS document and also searched in stack overflow but do not find any way to do that. Is it possible to do? If possible what is the proper way to implement this ?

Again I am new in "Apps for Office" development. I may miss any initial knowledge regarding my question. Please refer me the proper way. Thanks in advance for any types of help.

like image 369
hasnayn Avatar asked Aug 08 '26 03:08

hasnayn


1 Answers

Office.js Add-ins are web apps hosted within the context of an Office application. Generally speaking, anything you can do in a traditional browser can be done within an add-in. They are inherently cross-platform, designed to work across Windows, Mac, iOS, Android and Web.

This particular scenario doesn't work however. You could trigger the download of a .lnk file but you would have to instruct the user how and where to save it. More importantly, only Windows would understand what to do with this file type. Other platforms don't store web links in the same manor or in the same location.

like image 104
Marc LaFleur Avatar answered Aug 10 '26 10:08

Marc LaFleur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!