14

I use Microsoft email at work. I use the webmail interface. (I think this is called Outlook 365 webmail). I notice that when you read an email a unique URL shows at the top of the screen. What I would like to be able to do is copy and paste that URL into my organisational software (I use "Checkvist" which is an online outliner which is vaguely similar to Org-Mode). This is so that I can link certain tasks to certain emails. However, when I copy the URL and paste it into a new window, nothing happens (it takes me to the web app, but does not open the relevant email). Does anyone know a way to go to the relevant email using the URL?

Thanks

N

Nick Riches
  • 193
  • 1
  • 1
  • 6

7 Answers7

13

So I have found the following ways after much trial and error this morning:

Solution 1 - Create URL using the ID from email URL

Firstly for this to work you need to turn off conversation mode in OWA, you can do this by clicking the cog in the top right whilst in your mailbox then under "Conversation View" set this to off. (This is so the URL when you have an email selected will give you the message/item ID and not the conversation ID.)

Then select the email that you want to create a link to, the URL will look like below but with [MESSAGE_ID] showing the full message ID in a URL encoded format.

https://outlook.office.com/mail/inbox/id/[MESSAGE_ID]

Copy the full [MESSAGE_ID] and insert it as shown in the following URL:

https://outlook.office.com/owa/?ItemID=[MESSAGE_ID]&viewmodel=ReadMessageItem&path=&exvsurl=1

When opening this link it will take you directly to the email.

Please see the below powershell script that will open a form, you insert the URL copied from the browser into the 1st text box and click "Convert", this will then return the URL that will point to the email in O365 and clear the 1st field so that its quick to convert a few in a row, also the window should stay top most. This will still require the conversion mode to be set to off as mentioned in the 1st paragraph. I would like to add that this has been very quickly knocked up using PoshGUI editor and anchors etc have not been set so expanding the window may not have the desired effect.

Function Convert-URL{
Param(
    [String]$O365_URL
)
    $inputURL = $O365_URL
    $returnURL = "https://outlook.office.com/owa/?ItemID=" + ($inputURL | Split-Path -Leaf) + "&viewmodel=ReadMessageItem&path=&exvsurl=1"
    $returnURL
}

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()

$Form                            = New-Object system.Windows.Forms.Form
$Form.ClientSize                 = '735,80'
$Form.text                       = "O365 URL Convertor"
$Form.TopMost                    = $true

$TextBox1                        = New-Object system.Windows.Forms.TextBox
$TextBox1.multiline              = $false
$TextBox1.width                  = 446
$TextBox1.height                 = 20
$TextBox1.location               = New-Object System.Drawing.Point(150,5)
$TextBox1.Font                   = 'Microsoft Sans Serif,10'

$Label1                          = New-Object system.Windows.Forms.Label
$Label1.text                     = "Insert URL"
$Label1.AutoSize                 = $true
$Label1.width                    = 25
$Label1.height                   = 10
$Label1.location                 = New-Object System.Drawing.Point(21,12)
$Label1.Font                     = 'Microsoft Sans Serif,10'

$Label2                          = New-Object system.Windows.Forms.Label
$Label2.text                     = "Returned URL"
$Label2.AutoSize                 = $true
$Label2.width                    = 25
$Label2.height                   = 10
$Label2.location                 = New-Object System.Drawing.Point(21,38)
$Label2.Font                     = 'Microsoft Sans Serif,10'

$TextBox2                        = New-Object system.Windows.Forms.TextBox
$TextBox2.multiline              = $false
$TextBox2.width                  = 446
$TextBox2.height                 = 20
$TextBox2.location               = New-Object System.Drawing.Point(150,34)
$TextBox2.Font                   = 'Microsoft Sans Serif,10'

$Button1                         = New-Object system.Windows.Forms.Button
$Button1.text                    = "Convert"
$Button1.width                   = 100
$Button1.height                  = 30
$Button1.location                = New-Object System.Drawing.Point(619,9)
$Button1.Font                    = 'Microsoft Sans Serif,10'

$Form.controls.AddRange(@($TextBox1,$Label1,$Label2,$TextBox2,$Button1))

$Button1.Add_Click({$TextBox2.Text = Convert-URL -O365_URL $TextBox1.Text; $TextBox1.Text = "";})

$Form.ShowDialog()

Solution 2 - Office 365 Graph API

The property "Weblink" is returned from the "Get-Message" API request.

Please see the below sources that show this property:

Under the response you will see the "weblink" property, the URL is constructed the same as the solution above.

https://docs.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0&tabs=http

The following link is to the graph explorer, of which you can sign in and interact with the graph API to see a working example, after signing in click "Get My Mail" in the left pane". This will return an API response in the bottom right of all you emails and you will the weblink returned for each email in this window.

https://developer.microsoft.com/en-us/graph/graph-explorer

However whilst the above is not very practical to use manually, this is where I would start to make a script / programme to retrieve the URL.

CraftyB
  • 1,853
  • 10
  • 15
  • Cheers for comprehensive answer. Will check it out over the next couple of days. – Nick Riches Feb 01 '20 at 00:19
  • Many thanks. I've tested the first solution which works very well. I don't have the level of technical ability to understand the second. I just wish there was a way to address this without switching off conversation mode, which I find very useful, but clearly this is an issue related to the way Microsoft has designed its webmail. – Nick Riches Feb 01 '20 at 12:28
  • P.S. there is a Chrome extension called "URL editor" which could do some of the heavy lifting. – Nick Riches Feb 01 '20 at 12:36
  • A bookmarklet can automate this: https://superuser.com/a/1747542/13889 – endolith Oct 14 '22 at 16:48
  • Solution 1 does not work anymore. I spent days on this, even learning about Graph and creating new MS Live accounts for testing. The weblink returned from Graph does indeed work, but it is much longer than what I get when I use your Solution 1. I don't see how to construct the actual working weblink url, from the parameters I know. It appears to contain random strings. – Mads Skjern Nov 06 '22 at 21:23
  • If it does in fact work for you, could you please elaborate your answer with an example of actual data, including outlook url and message id. – Mads Skjern Nov 06 '22 at 21:25
  • Furthermore, even with the weblink url that I got via Graph, if the email is moved to another folder, the url does not work any longer. – Mads Skjern Nov 06 '22 at 21:27
  • @MadsSkjern I have just tested solution 1 and this still works fine for me, could you please confirm that your conversation mode is still disabled? with regards to the email being moved to a different folder this is known behaviour for alot of microsoft services / products, I will look into if there is a way to work around this but from knowledge this is an annoying feature of using microsoft products. – CraftyB Nov 07 '22 at 14:39
  • @CraftyB: Appologies for my late response, I have been under a lot of pressure. After having retried, I admit that your solution does work. I guess I did something wrong to begin with. On top of that, I observed that with conversations disabled, the URL did not change while browsing through emails. But I was wrong; the URL does change but only one (or two) character out of 50+ characters. Example: https://i.imgur.com/g9mcl0x.png – Mads Skjern Nov 13 '22 at 11:24
8

You can get an email URL by:

  1. Right-click the email and/or thread and "Create Task"
  2. Switch to To-Do / Tasks (bottom left of OWA interface menu, checkmark icon)
  3. Click on the task
  4. Right side info pane opens up
  5. Copy the link from the text "Open in Outlook"

This is a link to the message and/or the conversation. I haven't tested specifically but it will at least get you to a message from the thread you're looking for.

It's a little bit of a pain for high-level use but casual integration with a task program would be fine.

This does open the message in a new tab, which is not ideal; but again, it may be more for memory/follow-up than for quick-fire GTD stuff.

Worthwelle
  • 4,538
  • 11
  • 21
  • 32
Nick
  • 81
  • 1
  • 1
2

I added an HTMLText control on the form and set the default to this. The form field maps MessageId to this control. I have display mode as view so saving doesn't add the HTMLText. Now the Sharepoint List has a direct link to the message in Outlook.

<a href=""https://outlook.office365.com/owa/?ItemID=" & EncodeUrl(Parent.Default) & "&exvsurl=1&viewmodel=ReadMessageItem"">[open]</a>

Later, I used Power Automate to add new email to a SharePoint List and build the same URL format to automatically set the message link and conversation links.

SharePoint lets you customize the details form to show PowerApps:

SharePoint Screenshot Link

In PowerApps, you can add HTML controls to your form. Above you can edit the HTML text to use an anchor link that opens on the outlook web with your message.

PowerApp Screenshot Link

zx485
  • 2,170
  • 11
  • 17
  • 24
tgraupmann
  • 21
  • 2
  • 1
    Welcome to superuser. Your answer is missing context. Please improve it. Some screenshots could help too. – Máté Juhász Aug 15 '21 at 11:01
  • 1
    I added a couple screenshots; one for SharePoint where the form displays; one for PowerApps where I used an HTML control to create anchor links. I need more rep to display the screenshots. – tgraupmann Aug 16 '21 at 17:09
2

Here's an easier way to get to CraftyB's solution using a bookmarklet in Firefox:

Create a new bookmark in the Bookmarks toolbar:

Add Bookmark

Use this javascript as the URL:

javascript:(function() {
window.open('https://outlook.office365.com/owa/?ItemID='
.concat(window.location.href.split("/id/")[1])
.concat('&exvsurl=1&viewmodel=ReadMessageItem')
)
;})()

Name it whatever you want and maybe add a keyword:

Edit bookmark

Now whenever you want to create a permalink, find the email in question (so it's visible in the right side pane), and click the bookmarklet (or enter your keyword into the URL bar) and it will open a new tab to a permalink URL for that message.

This variant replaces the current tab, if that's useful to anyone:

javascript:(function() {
window.location='https://outlook.office365.com/owa/?ItemID='
.concat(window.location.href.split("/id/")[1])
.concat('&exvsurl=1&viewmodel=ReadMessageItem')
;})()
endolith
  • 7,507
  • 25
  • 84
  • 121
0

I have found a relatively non-technical work around for this question after a lot of trial and error. I save alot of emails in OneNote, and in older versions of One Note, you can drag and drop specific emails to be saved on the page. But this isn't possible in OneNote 365 (to my knowledge).

However, I have found that I can save a print out of the email in OneNote, and then copy and paste the hyperlink to the specific email in the outlook webmail interface. However, the trick/work-around as far as I can tell, is that the email CANNOT be still in the inbox, but must have been moved to a different folder. If it remains in the inbox when you copy-and-paste the hyperlink, when you click on it, it will just open the inbox, instead of opening the specific email you want. This works for me in both Chrome and Edge, I hope others also find it useful.

Hilary
  • 1
  • Thanks. I will take a look. But this sounds slightly long-winded, and doesn't enable working with a non-microsoft organisational app. – Nick Riches Aug 05 '21 at 06:18
0

options might have improved - on the browser version, I disabled the conversation view, open the email, copy the link from the browser view and paste it in the other app. when i click on the link in the other app, it opens exactly this email. (using office 365)

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 31 '22 at 03:01
0

One work around that's similar to the right-click and "Create Task" option but maybe slightly easier, just flag the email, then open Microsoft To Do and the message will appear in the Flagged Emails list. Then you can just right click on "Open in Outlook" and copy the link. You'll notice that the URL is different than what appears in the address bar when you simply click on the email in the inbox.

Anon
  • 1