0

MS Office Add-in (web) doesn't save URL destination inside. For example 1. you add content Add-Id in your document 2. change URL inside (click the link inside it) 3. save it

After you will open your saved document website inside your add-in will be default, not that you have reached before saving

How to fix this error?

Alex
  • 33
  • 6

1 Answers1

1

i am not sure I get what you are trying to achieve, would be great if you can describe your scenario with more details.

But I can tell you this: Nothing on the add-in state gets saved with the document unless you explicitly save it with it. In order to do that you need to use the settings object. its quite simple to use here are good documentation on how to create and get a setting http://dev.office.com/reference/add-ins/shared/settings

Hope this helps.

Juan Balmori
  • 4,898
  • 1
  • 8
  • 17
  • Juan, thanks for your answer. We a creating web add-in for powerpoint, its multipage (it has link inside main page that is shown inside add-in). So user can reach different url. But after saving and opening documents all reaced URLs inside add-ins will be reseted. So user have to do this work one more time. Its very inconvenient. – Alex Oct 06 '16 at 12:57
  • Your walk around it's not suitable. User can add aditional pages|slides to his document, so information in document settings (page of odd-in and it's URL) will incorrect in moment – Alex Oct 06 '16 at 13:05
  • that depends on how you code your solution, but definitely the settings object will help you on this scenario. So this is the flow of events i see in your solution. 1. addin is activated. 2. during add-in initialziation, you can check to see if the setting that you stored contained any values (first time will be empty, of course), if not empy you retrieve the URLS and use them as you need. 3. when a new URL is used you store them using the settings.set method and then settings.async (so that they permanently saved as part of the document. Note that you can store an array so you can have multip – Juan Balmori Oct 07 '16 at 01:13
  • multiple URLS on that array. Finally, you need to be careful on this urls, i am not sure from what you are describing so far how you will use the URLS but if you are intending to navigate the current frame to another location you need to make sure all of those domains are part of the AppDomains entry in your manifest, and of course you need to know that cross domain urls will be blocked by the browser. – Juan Balmori Oct 07 '16 at 01:18
  • Juan, thanks! we willuse this walkaround, hope MS add-ins environment wiil save Add-ins URL locations in latest versions – Alex Oct 08 '16 at 17:59