Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Word macro to code
Message
From
07/10/2008 16:07:47
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Convert Word macro to code
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01353435
Message ID:
01353435
Views:
70
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
Next
Reply
Map
View

Click here to load this message in the networking platform