View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Help with VBA Mail Merge

I bet you'd get more answers in an MSWord newsgroup.

Claude wrote:

Hi,
Could someone please tell me if it is possible to include a mail merge
field in the "Address:=" part of this code located at the bottom? I
guess what I'm trying to do is include my own text & mail merge field
in the label?
I was hoping the the following could somehow be inserted?

ActiveDocument.MailMerge.Fields.Add Range:=Selection.Range, Name:= _
"Distribution"

ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
ActiveDocument.MailMerge.OpenDataSource Name:= _
"S:\mag-hr\Payroll\Payroll@Magill\Reporting\Group Distribution
List Weekly.xls" _
, ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="Entire Spreadsheet",
SQLStatement _
:="", SQLStatement1:=""
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CreateNewDocument Name:="L7163",
*Address:= _
"Weekly Payslips - Private & Confidential" & Chr(13) & Chr(13)
_
& Chr(13) & "Weekly Payslips - Private & Confidential" &
Chr(13), _* AutoText:="", LaserTray:=wdPrinterManualFeed

Not having much luck!
Thanks
Claude

--
Claude
------------------------------------------------------------------------
Claude's Profile: http://www.excelforum.com/member.php...o&userid=27992
View this thread: http://www.excelforum.com/showthread...hreadid=474979


--

Dave Peterson