I created Macro1 for a label mail merge. I find by looking at the VB code, the label info ( name, address, City,st,zip) is probably located in the AutoText:="ToolsCreateLabels1". See the example below. If I RUN this Sub directly, it generates the page of labels as it should. If I paste it into another macro and rename it to a Function, I can call it from macro #2 and it works ok.
If I delete Macro1, then macro2 cant find the address fields. It seems that Macro2 is still looking at Macro1 for the address fields. How can I carry the Address fields for the label into the Macro2? Better yet, where is the AutoText defined and where is "ToolsCreateLabels1" stored.
Thanks
Burr Stephens
Anderson IN
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/25/01 by Burr Stephens
'
ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Program_Source_Files\St Matthew Membership.mdb", ConfirmConversions:= _
False, ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
Connection:="TABLE MiscMergeMail", SQLStatement:= _
"SELECT * FROM [MiscMergeMail]", SQLStatement1:=""
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CreateNewDocument Name:="", Address:="", AutoText _
:="ToolsCreateLabels1"
End Sub
Burr Stephens
If I delete Macro1, then macro2 cant find the address fields. It seems that Macro2 is still looking at Macro1 for the address fields. How can I carry the Address fields for the label into the Macro2? Better yet, where is the AutoText defined and where is "ToolsCreateLabels1" stored.
Thanks
Burr Stephens
Anderson IN
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/25/01 by Burr Stephens
'
ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Program_Source_Files\St Matthew Membership.mdb", ConfirmConversions:= _
False, ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
Connection:="TABLE MiscMergeMail", SQLStatement:= _
"SELECT * FROM [MiscMergeMail]", SQLStatement1:=""
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CreateNewDocument Name:="", Address:="", AutoText _
:="ToolsCreateLabels1"
End Sub
Burr Stephens