The definitive guide to why pasted URLs/URNs frequently don't work, but sometimes do

TL;DR version: Some Office 2016 products seem to have changed how it treats URLs pasted into it's products. I'm not sure when this update occured, or if other apps do similar things. I've tested this with Word, One Note and Outlook 2016.

Office 2016 seems to convert URLs pasted into them by percent encoding the URL. It ignores HTML encoded characters. ProjectWise URNs use braces that are always converted by Office 2016 to their percent encoded versions. Paths using spaces and copied from PW using the normal Copy command (or ctrl-c) in the address bar will also have problems.  Using Copy URL should work for paths with spaces (the spaces are HTML encoded to &space;) but may have problems with "weird" characters that doen't have HTML encoded versions.

Gory detail version:

Testing ProjectWise Explorer 10.00.03.140 with One Note 2016, Outlook 2016 and Word 2016

There are 2 methods of encoding "weird" characters for use in URL and/or HTML. Percent encoding is technically the version you should use for URL, URI and URNs. Bentley does this when you right-click the address bar and select Copy or Copy URN.  If you get the actual link (right-click on the link and select Copy Link) and paste in notepad you'll see this encoding for spaces using %20, open brace as %7b and close brace as %7d.

https://en.wikipedia.org/wiki/Percent-encoding

HTML entity encoding uses an ampersand, and entity name, and a semi-colon. You'll see this for spaces as &space; or less than as <. ProjectWise uses this method when you right-click a file and select Copy URL.

https://en.wikipedia.org/wiki/HTML_encoding

I wasn't explicit above but there are 4 ways to copy a link from ProjectWise:

  1. Select the address bar contents, Ctrl+C
  2. Select the address bar contents, right-click select Copy (just Copy)
  3. Right-click the address bar, select Copy URL
  4. Right-click the address bar, select Copy URN

Methods 1, 2 and 4 use percent encoding . Method 3 uses HTML entity encoding.

If you select a file where the path has no "weird" characters (i.e. no spaces, no semi-colons, no ampersands, no percent signs) then methods 1, 2, and 3 will work fine. Method 4 will fail.

If you select a file with spaces in the path (or any other characters that can be HTML encoded)  then method 1, 2 and 4 will fail. Method 3 will work.

Method 4 always fails because URNs contain braces around the GUID and they are always percent encoded.

You can see how Office changes the encoding by doing the following:

In ProjectWise Explorer right-click the address bar and select Copy URN.

Open Notepad and paste into Notepad. You'll see the URN version has the braces are normal brace characters.

Paste into Word

Right-click the link in Word, select Copy Hyperlink

Paste that into Notepad

Now you'll see the URL has changed so { is %7b and } is %7d

Even if you edit the hyperlink in word to undo the percent encoding it will change it back.