View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Help required to debug mailmerge procedure

Do you have a reference set to the Word Object Library in the Excel VBE
under the References menu

--
Regards,
Tom Ogilvy

"JRB" wrote in message
...
I am attempting to run a mailmerge from Excel (Office 97) using the
following procedu
It doesn't work .... and I am tearing my hair out - please help before I

am
completely bald
TIA

.............
Sub PrintLabels()

Dim WD As Object

Set WD = CreateObject("Word.Application")
WD.Application.DisplayAlerts = wdAlertsNone
WD.Documents.Open (ThisWorkbook.Path & "\BDayList Labels.doc")
WD.ActiveDocument.Mailmerge.Destination = wdSendToPrinter
WD.ActiveDocument.Mailmerge.Execute
WD.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
WD.Application.DisplayAlerts = wdAlertsAll
WD.Quit SaveChanges:=wdDoNotSaveChanges
Set WD = Nothing

End Sub
.............