UNTESTED
try it
Sub UpdatedQMISReply()
Dim msg1 As String, msg2 As String
Dim doc As Object, sel As Object
Dim Location, Location2
msg1 = "Please enter the UNC (http://) path for the new file"
msg2 = "Please enter the QMIS path for the new file"
Location = InputBox(msg1, "UNC location")
Location2 = InputBox(msg2, "UNC location")
Set doc = ActiveInspector.WordEditor
Set sel = doc.Application.Selection
With sel
.TypeText Text:="Dear User,"
.TypeParagraph
.TypeParagraph
.TypeText Text:="This email is to confirm that your recent " & _
"file update request to QMIS has now been " & _
"completed. I have uploaded all the requested " & _
"files and have saved a copy into the archive folder "
.TypeText Text:="(if an old file existed)."
.TypeParagraph
.TypeParagraph
.TypeText Text:="The location on QMIS for the uploaded document is: "
.Hyperlinks.Add Anchor:=.Range, Address:=Location, SubAddress:="", ScreenTip:="", TextToDisplay:=Location2
.TypeParagraph
.TypeParagraph
.TypeText Text:="If your update was concerning a Health & Safety " & _
"Document such as a Risk Assessment, or Safe System" & _
" of Work, then please note that the naming " & _
"convention for these documents is changing, also " & _
"the location of the document may change without " & _
"prior warning as the QMIS infrastructure is modified."
.TypeParagraph
.TypeParagraph
.TypeText Text:="Should you have any further queries regarding " & _
"this update then please do not hesitate to contact me"
.TypeParagraph
.TypeParagraph
.TypeText Text:="Regards"
End With
End Sub
Alternatively, in your actual code, replace
***ActiveInspector.WordEditor.Application.Selection.Hyperlinks.Add Anchor:=Selection.Range, Address:=Location, SubAddress:="", ScreenTip:="", TextToDisplay:=Location2***
WITH
ActiveInspector.WordEditor.Application.Selection.Hyperlinks.Add _
Anchor:=ActiveInspector.WordEditor.Application.Selection.Range, _
Address:=Location, SubAddress:="", ScreenTip:="", TextToDisplay:=Location2
source
share