I am adding a hyperlink to a document, that includes a query string.
URL example: https://www.website.com.au/paynow/ext?rn=555&amt=95.40
I add this to the document like so -
Dim hyperlink As Word.Hyperlink = WordDocument.Hyperlinks.Add(Me.Range, URL, "", "", "Click me to visit the website")
This opens the website and ignores the query string passed in (basically running https://www.website.com.au
.
If I copy the hyperlink link directly (open the document, right click on the hyperlink and select "copy link"), then open a browser and paste it --> the url loads correctly, with the query string being used.
I have checked through fiddler, and it seems like the document add-in is using the final re-direct URL returned. From reading, it seems this could also be a known issue with the Office product?
Also - if I (programatically) take the same URL I'm adding to the hyperlink and add it to a Process.Start("URL"), it loads perfectly fine.
[I even tried encoding the URL - no difference].
Any ideas, starting to go crazy here?
Thanks in advance.