PDA

View Full Version : Mail Merge and Hyperlinks



dimmutal
04-04-2006, 04:48 PM
I'm using the mail merge in Word to take data from Excel, and place them as i wish in Word. Everything works fine but it seems that some data in Excel that are hyperlinked to some files appear as plain text after the mail merge in Word? Why does this happen? Is it a known issue? How can I preserve the link information of my Excel data in Word?? Note that copy-paste data from Excel to Word doesn't work for me because i want to make my data appear in a certain way. Thanks

lucas
04-04-2006, 08:54 PM
Hi dimmutal,
I'm not too sure about Word but I don't understand why or how your using mail merge to move data from excel to word. May be normal but this macro is run from excel and will copy the designated range to a new word document. Not sure what your looking for....


Sub CopyTableToAnyWordDocument()

Dim wdApp As Word.Application

ThisWorkbook.Sheets("Table").Range("A1:B7").Copy
Set wdApp = New Word.Application
With wdApp
.Documents.Add
.Visible = True
End With
With wdApp.Selection
.EndKey Unit:=wdStory
.TypeParagraph
.Paste
End With

Set wdApp = Nothing

End Sub


ps it copies the hyperlinks also.

dimmutal
04-05-2006, 05:19 AM
Thanks, but as i said this won't work. There are data from many columns that i use and through mail merge i place them in a certain way in my word document. So, copy-paste won't work for me, as i don't want to place a table.

TonyJollans
04-05-2006, 09:56 AM
I don't think you can; mail merge just merges textual content. You will need to create the hyperlinks some other way as a post-process.