I have developed an Office add-in. It contains an editor where users could type and save a text.
I want to realise a feature: 1) One option is, when a user closes a spreadsheet/document, I want to remind them of saving the text on the add-in (by simply clicking on a button of the add-in); 2) another option is, when a user closes a spreadsheet/document, the text on add-in is systematically saved.
In either case, we need to be able to listen to the event when a document is closed, or a browser tab is closed (if it is Office Online).
Does anyone know how to realize this?
There is no close document event API yet. You can make your API request here. The event to intercept document/tab/window close action is not possible consistently because the process itself could end and also JS APIs are asynchronous in nature.
The Word API offers save API that could be used to save the document. Word also offers document.saved (Boolean) API to check periodically and save the document if that matches the requirement. Excel also offers workbook.saved API (still in preview) but not the save() API.
Related
I'm trying to establish if this is even possible:
Can an outlook web add-in (i.e. a JavaScript add-in that works on the web and in outlook, not a COM based add-in) modify the body of an email while in read mode (i.e. the user is reading an email, not composing a new email or replying to an email).
What I need to do is trigger the add-in if the email contains hyperlinks (looks like I can do that with a contextual add-in using a regular expression) and then modify those hyperlinks (change the href or add an onClick event handler) so if the user clicks them the behaviour is different.
Based on #OutlookAdd-insTeam-MSFT comment I'll post my own answer:
You cannot modify the body of an email in read mode.
:(
Cant comment. Not enough rep.
I am looking at the documentation for Read Scenario I dont see anything related to set property.
However I do see something about extracting info from an item, more importantly extracting URL's
May be you can extact URL's do your modifications and with the new content you can create a New message item or even Reply and Reply all
It should be able to do that using calling UpdateItem via EWS from the add-in, right? See https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/updateitem-operation
Why wouldn't that work #microsoft?
I am building an outlook-addin which saves the data in the RoamingSettings.
Using the code :
Office.context.roamingSettings.set('key1', 'AmIABug');
Once I save it in RoamingSettings my assumption is that when I open an email on the OutlookWebApp. It will immediately pull that save value when I request for it.
Office.context.roamingSettings.get('key1');
However this is not the case.
First, considering that there is an issue with RoamingSettings : Pointed out here.
Why Outlook's RoamingSettings object initialized with old values after page re-load/ redirect?
Which I was able to overcome with the work around mentioned:
https://github.com/joeparzel/RoamingFix
which seemed to work properly on the Outlook client, however Now. I am using the OutlookWebApp and what I see is that even when I have the OutlookWebApp already open I do not see the new RoamingSettings values when requested even when I close the TaskPane on one email and open the same using another email.
If I refresh the page I get the expected output. Can someone please tell me if RoamingSetting for OWA is only set once when the page loads, unlike the thick client where if I reopen my task pane, it gets the latest values.
In may have I missed something silly, please help.
This is the expected behavior. OWA only loads RoamingSettings once which is why when you reload the page you get the new values. Also note that since you are using a thick client to set the properties and the thick client by default runs in cached mode, there may be cases where you might not get the properties back on owa even after reload for some time since the properties haven't been synced back to exchange from thick client yet. Once thick client's sync kicks in, you should be able to see the props in OWA after a reload.
I am working on an Outlook mail app, which will be available to user on web only (not of outlook desktop).
A file need to be uploaded from app to azure via custom control in compose form of App, meanwhile the file is uploaded to Azure user should not be able to close the mail. If they try to do so, a warning should be given to them.
Adding to #Slava's answer, I would suggest using addAsync API for notification messages. You can add a notification of type progress indicator until your task is complete and replace it with a notification of type informational message.
Click here for reference
Unfortunately Office.js API does not have the feature you are inquiring. You will not be able to disallow user interaction, as such closing the compose window or closing your add-in. As the API doesn't have "OnSend" or "OnClose" events you will not be able to display any warning either. If this is the new feature you would like to add you may try to send request via Office Developers User Voice.
As the work around you should clearly indicate for the users that they need to wait and do not interup operation. You should display activity indicator, indeed. And finally you should be prepare user still interupt the operation in the middle and work properly with the error occur.
Hope this helps.
I have an xpage without any data source being used to compile a report. Now I want to send link of this page to different people at 04:00 PM everyday. I am using lotusScript agent to send an email. It's running perfectly fine for web link to open an xpage but notes client link its not opening the page. I am using IBM Notes 9.0.1. Below is the sample code from agent.
Call mailRT.AppendText(" For Web Link ")
Call mailRT.AppendText("http://172.17.5.36/sar.nsf/DailySummaryReport.xsp")
Call mailRt.AddNewline(2)
Call mailRT.AppendText("IBM Notes Client Link --->>> ")
Call mailRT.AppendDocLink(db,"Click to Open Daily Sales Activity System")
Call mailRt.AddNewline(3)
Call mailRT.AppendText("Best Regards, ")
Call mailRt.AddNewline(1)
Call mailRT.AppendText("notes://172.17.5.36/sar.nsf/DailySummaryReport.xsp")
I don't know what is appropriate way to open a an xpages from an email. if i use
Call mailRT.AppendText("notes://172.17.5.36/sar.nsf than it's open launching page of the application otherwise open view last viewed by the user( Call mailRT.AppendText("notes://172.17.5.36/sar.nsf/DailySummaryReport.xsp") ).
Kindly guide me the way forward.
Thanks,
Qaiser
I would send messages always a MIME. It gives you more flexibility in formatting and layout. Stick to the link approach since embedded forms are a security hazard. Start with the eMail bean (you can adopt it to an agent).
When your XPage opens with all the fields you need in edit mode, that's the URL you want to use. if you use http it would open in the browser, use notes it opens in the client.
I am storing Infopath forms in a Sharepoint Document Library.
Because these forms are completed in a disconnected environment, the document library is used for storing the submitted forms (and other related documents). A web application also updates the Infopath documents.
The Infopath Template associated with the forms is installed on user's PCs as an msi.
I've noticed that if a user has one of the forms open from the document library (but not checked out),using the Copy web service to update the document returns a "DestinationCheckedOut" error. My question is, is there anything I can use to query Sharepoint to determine if a user has the file opened. I've used Lists web service and CheckoutUser but this only worked if document is checked out (not just open). I've also tried setting "Version Settings" to "Require documents to be checked out when edited" but doing so returns the error "Infopath cannot open the following file:.....The file is not a valid XML File" when the form by opened by a user.
I am going to handle the "DestinationCheckedOut" exception but wanted to have my code check for this scenario first before the update process is attempted.
Any help would be appreciated.
I don't know if there is any Web service that return the information you are looking for.
The server side object model calls are SPFile.CheckOutStatus and SPFile.CheckOutType ( http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfile_properties.aspx ). There are 2 types of "checked out" one when document is simply opened for editing and the other when it is explicitly checked out - you hitting the first one.