Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Convert Word macro to code
Versions des environnements
Hello,
I have created a macro in Word I need to work into some existing code. I basically just copied it in and as you can imagine, it found errors everywhere! I'm not surprised, but grateful I can turn to all of you. The following is what was created in Word (and does not give me insight into how to start Word either):
Sub guestlabels()
'
' guestlabels Macro
' Macro recorded 10/7/2008 by Martha Kroll
'
ChangeFileOpenDirectory "C:\byteworks\gmr\lunches\"
Documents.Open FileName:="GUESTLABELS.DOC", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
End Sub
My customer is frustrated trying to deal with a mail merge and my intent is to remove their need to be involved in that part of the process.
Any suggestions as to how to work this into my code would be greatly appreciated.
Thanks so much,
Martha Kroll
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement