Restrict user from closing outlook mail app, while some action is in progress - ms-office

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.

Related

Outlook add-in check inline reply mode

I was forwarded to stackoverflow for questions.
I have created an addin for outlook that i want to publish on Add-ins store.
I have received failures on my application that i need to resolve.
When the user has made the action in my add-in. I close the email with
"Office.context.mailbox.item.close()"
https://learn.microsoft.com/en-us/javascript/api/outlook/office.messagecompose?view=outlook-js-1.5#close--
When using Outlook Desktop and replying with "inline reply mode" this method does not work. Is there a way to check if the mail is in "inline reply mode" or not?
I have made a image to be shown that the process is finished and i hope this works since closing the taskpane does not work.
As you noted above, Office.context.mailbox.item.close() does not work for inline replies in the desktop Outlook client. Unfortunately, we have no way of checking whether the email is in inline reply mode or not. We have a UserVoice page where we track feature requests. Please don't to add a feature request there. Feature requests on user-voice are considered, when we go through our planning process.

How to customize Outlook OnSend error message

I looked around the documentation but could not find an answer. I know you can add up to 5 error messages but is it possible to edit the default message that says:
The addin "AddInName" is blocking this email from being sent?
Currently this is not a part of the product. We track Outlook add-in feature requests on our user-voice page. Please add your request there. Feature requests on user-voice are considered when we go through our planning process.

Cancel Gmail auto save of draft programmatically

I need to encrypt the real message that user write in compose mode in Gmail , so I created a Chrome extension that creates another button of 'secure send' in compose window ( I am using gmail.js library and InboxSdk library ). The problem is that when user write a new message a draft save automatically every time user keep writing and the real message actually not secure.
I think about update every time the draft when user change the content via Gmail API Users.drafts: update but the problem that also here it's save for a while to Google and I don't want it.
Is there some option to cancel the auto save of the draft? Then maybe I somehow try to save the draft by myself.. I don't see anything about this in the gmail.js and InboxSDK library's and also in the rest of my research...
AFAIK gmail-api hasn't a method to block the Gmail UI draft message autosave. In an scenario like the one described on the question, I think that the best is to avoid the use of the Gmail UI to compose new messages.
Anyway, Gmail draft autosave on the UI is done by using AJAX. I suggest you to try to find out which request sends the body of the draft messages and block it only while your extension users writes something to be encrypted.

Can i get the event about file operation on OneDrive?

As we know, we can add remote event receiver to the list. then if there is a item added or updated in this list, we can get the event send by sharepoint 2013 online.
This is the info about event in sharepoint:
[https://msdn.microsoft.com/en-us/library/Microsoft.SharePoint.SPItemEventReceiver_methods.aspx]
So can we have this kind of method in OneDrive(skydrive) too?
It means when there is a file added in the OneDrive, then my App can get this event and take some action on this file.
thanks.
The OneDrive API does not (yet!) support subscriptions to events. Please visit the OneDrive user voice and make/vote up topics that you'd like to see implemented.
To question #2 the view.changes api allows for applications to easily know which changes have happened since the application last queried OneDrive might be just what you need without subscriptions.

Add custom text to Sharepoint Email Alert

We have an alert set-up for sharepoint list, but I want to add some custom text to the alert email. We do not have any access to SPD or sharepoint server and can make changes to sharepoint client only.
Can anyone please advice?
The code that sends out emails runs on the SharePoint server via the Timer Job. Since you have no access to do anything with the server you've got absolutely no chance of modifying the built in alert emails.
Could you do this with javascript?
You can't send emails with JavaScript directly. You can open up a draft email in a users default email client using a mailto link but this won't achieve what you want as a user will still have to edit it.
You could, I suppose, put some javascript onto an edit page using a content editor web part (which you can do without SPD) to on changes make an AJAX call to a separate web server to do the actual sending.

Resources