Get browser URL in an outlook add-in - outlook

I am developing an outlook add-in that requires to save email location. For that, I want to get the browser URL corresponding to the opened email . How do I get the outlook host window's URL from the outlook add-in? Is there any method to save email location?
window.location gives me the location of my add-in not that of the browser.

You can use the graph API to get the item's link using the weblink property. Details are here in this link. https://learn.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0

Related

How to send an email from an outlook office add on?

I am trying to build an outlook add on, using react. I looked everywhere trying to find something that uses the mailbox in which the addon has been opened from, to programmatically send an email to a specified user.
Something similar to the google's command:
GmailApp.createDraft(e.parameters.address, e.parameters.subject, e.parameters.body, {
htmlBody: e.parameters.body,
name: 'Automatic Sender'
}).send();
Is the mail-sending process available on outlook?
Outlook web add-ins work under the context of currently selected item only. OfficeJS doesn't provide anything for creating and sending emails programmatically.
In Outlook add-ins you may consider using EWS, see Call web services from an Outlook add-in for more information. Also you may take a look at the Graph API as a possible workaround.

Outlook and Gmail Link to create event

I'm using outlook and gmail links to create events.
I populate the params for each link and publishing it to the users.
The link for outlook:
https://outlook.office.com/owa/?path=/calendar/action/compose&rru=addevent&startdt=2021-05-24T12:00:00&enddt=2021-05-26T19:00:00&subject=Change This With A Subject &location=Change This With A Location&body=Change This With A Body Description.
My question is:
It's possible to click, for example, on outlook link (like the link above) to create the event, but somehow make it open the Desktop outlook app and not outlook web?
Many Thanks,
For the URL specified - no. They are run by web browsers by default.
URLs with the https protocol handler are run by web browsers. But you can register a custom protocol handler on a client machine that can launch Outlook by default and pass parameters as you do for a web browser. Read more about that in the Understanding Protocol Handlers article.
Also, you may find Outlook command-line switches helpful, see Command line switches for Outlook 365, 2019, 2016, 2013, 2010 and previous for more information.

Outlook Message webLink with ispopout=0 working only with Inbox

I'm currently building an integration with Office 365 Outlook thanks to the Microsoft Graph API. I retrieve user messages data, along with the webLink, which is a direct URL to the message in Outlook Web App.
By default, it opens in a popout window displaying only this message. My goal is to display it in the full Outlook Web App. In the documentation of a Message resource, Microsoft states this:
You can append an ispopout argument to the end of the URL to change how the message is displayed. If ispopout is not present or if it is set to 1, then the message is shown in a popout window. If ispopout is set to 0, then the browser will show the message in the Outlook Web App review pane.
Doing this works well if the e-mail is in the Inbox mail folder. However, if it is in another folder (like Sent Items or a custom one), it always redirects to the Inbox and opens the first message in it.
Is it a known limitation of this parameter? Is there a workaround to achieve this?
Best regards!

Get all changes to calendar in Outlook Web Add-in

I'm developing an add-in for Outlook Web (Outlook365 and Outlook.com) which needs to retrieve all changes in the calendar.
I tried to use the Calendar REST API, but when calling getCallbackTokenAsync to get the access token, the token I get is scoped, and when I call the Calendar REST API, I get this error:
{"error":{"code":"ErrorAccessDenied","message":"The api you are trying to access does not support item scoped OAuth."}}.
Does anyone have an idea about this or another way to get changed items?
I have same issue with this , just about attachments.
You need to set permissions of 'ReadWriteMailbox' in your manifest and then it's supposed to return 200 and not error..but right now there is a bug in outlook.
Read more here: Can't add attachment to message in outlook add-in using Outlook rest API
Good luck .

Outlook item to webDAV location

I have a web application which has a calendar, and I want to allow that calendar to be sync'd with an Exchange server.
I've written code to create appointments on an Exchange server directly in a user's calendar using webDAV. I save the appointment locations (URLs) so I can update the appointments in outlook if something changes in my application.
I'm trying to write an add-in for Outlook that lets a user send their appointment to my web application. In order to save it though (and allow updates in my application to propagate back to Exchange) I need to figure out what the appointment location (URL) is in WebDAV.
Is there any way to get the WebDAV URL of the appointment from within Outlook? I'm using VSTO for my outlook add-in.
Thanks for the help guys!
This question helped considerably:
How to use WebDav to match dav:href to Outolook Interop href value
And this website was interesting too:
http://www.infinitec.de/post/2007/03/Constructing-OWA-2007-item-ids-from-WebDAV-items.aspx

Resources