Copy Hyperlink from an Excel cell to a table in a Word document

jemcc

New Member
Joined
Nov 21, 2017
Messages
4
I have been tasked with creating a measurable metric, on the accuracy of our daily operating log. This is to be completed by a nightly review of the entries made through out the day. And, is currently being done by listing errors found in an email to supervision, with corresponding screen captures. Going forward, the screen shots will be saved in a common folder, and hyperlinked from the spreadsheet. And, I have all of that working. To make it easier on supervision, their overnight report is going to be compiled into a word document, and e-mailed to them. I have been able to get all of the info to populate correctly into the Word document, except the Hyperlinks. I can only get the text to copy. Below is my code, with the offending line in yellow. I am a novice to all of this, so any help on this would be greatly appreciated.

Thanks in advance,
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Sorry, apparently my session timed out. Here is my code. And the text in question is in blue.

Sub ImageSave() 'Populate Overnite Log & Conditions Audit Wod.doc
Dim objWord As Object
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet2")
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "F:\DOL Report Template.docx" ' change as required
With objWord.ActiveDocument
'Page 1
'Header info
.Bookmarks("bmDate").Range.Text = ws.Range("A2").Value
.Bookmarks("bmCase").Range.Text = ws.Range("B2").Value
.Bookmarks("bmOvernite").Range.Text = ws.Range("C2").Value
.Bookmarks("bmDisp").Range.Text = ws.Range("D2").Value
'Log Errors
.Bookmarks("bmLError1").Range.Text = ws.Range("E2").Value
.Bookmarks("bmLError2").Range.Text = ws.Range("F2").Value
.Bookmarks("bmLError3").Range.Text = ws.Range("G2").Value
.Bookmarks("bmLError4").Range.Text = ws.Range("H2").Value
.Bookmarks("bmLError5").Range.Text = ws.Range("I2").Value
.Bookmarks("bmLError6").Range.Text = ws.Range("J2").Value
.Bookmarks("bmLError7").Range.Text = ws.Range("K2").Value
.Bookmarks("bmLError8").Range.Text = ws.Range("L2").Value
.Bookmarks("bmLError9").Range.Text = ws.Range("M2").Value
.Bookmarks("bmLError10").Range.Text = ws.Range("N2").Value
'Conditons Errors
.Bookmarks("bmCError1").Range.Text = ws.Range("O2").Value
.Bookmarks("bmCError2").Range.Text = ws.Range("P2").Value
.Bookmarks("bmCError3").Range.Text = ws.Range("Q2").Value
.Bookmarks("bmCError4").Range.Text = ws.Range("R2").Value
.Bookmarks("bmCError5").Range.Text = ws.Range("S2").Value
.Bookmarks("bmCError6").Range.Text = ws.Range("T2").Value
.Bookmarks("bmCError7").Range.Text = ws.Range("U2").Value
.Bookmarks("bmCError8").Range.Text = ws.Range("V2").Value
.Bookmarks("bmCError9").Range.Text = ws.Range("W2").Value
.Bookmarks("bmCError10").Range.Text = ws.Range("X2").Value
'Comments
.Bookmarks("bmComments").Range.Text = ws.Range("Y2").Value
'Images
.Bookmarks("bmImage1").Range.Text = ws.Range("Z2")
'objWord.Selection.PasteExcelTable False, False, False
objWord.Selection.Selection.PasteSpecial
.Bookmarks("bmImage2").Range.Text = ws.Range("AA2").Value
.Bookmarks("bmImage3").Range.Text = ws.Range("AB2").Value
.Bookmarks("bmImage4").Range.Text = ws.Range("AC2").Value
.Bookmarks("bmImage5").Range.Text = ws.Range("AD2").Value
.Bookmarks("bmImage6").Range.Text = ws.Range("AE2").Value
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,748
Messages
6,180,721
Members
452,995
Latest member
isldboy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top