Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Word macro to code
Message
From
07/10/2008 17:18:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01353435
Message ID:
01353477
Views:
23
>>For being toooooooo sleepy, you're doing great! It compiled fine...then at...
>>
>>oWord.Documents.Open("C:\byteworks\gmr\lunches\GUESTLABELS.DOC")
>>
>>I got:
>>
>>Program Error
>>OWord is not an object
>>
>>Thank you SO much!
>>Martha
>
>Sure you got this :-)))
>I am the dum....s here:
>
>
>#define wdSendToPrinter        1
>#define wdDefaultFirstRecord   1
>#define wdDefaultLastRecord  -16
>
>LOCAL oWord
>
>oWord = CREATEOBJECT([Word.Application]) && W/o this nothing can work, even VFP9 :-))))
>oWord.Documents.Open("C:\byteworks\gmr\lunches\GUESTLABELS.DOC")
>With oWord.ActiveDocument.MailMerge
>     .Destination        = wdSendToPrinter
>     .SuppressBlankLines = .t.
>     With .DataSource
>          .FirstRecord = wdDefaultFirstRecord
>          .LastRecord = wdDefaultLastRecord
>      EndWith
>     .Execute()
>EndWith
>oWord.Visible = .t.
>
Boris,
You have done the heavy lifting a little touch:)
#define wdSendToPrinter        1
#define wdDefaultFirstRecord   1
#define wdDefaultLastRecord  -16

LOCAL oWord

oWord = CREATEOBJECT([Word.Application]) && W/o this nothing can work, even VFP9 :-))))
oWord.Documents.Open("C:\byteworks\gmr\lunches\GUESTLABELS.DOC")
With oWord.ActiveDocument.MailMerge
     .Destination        = wdSendToPrinter
     .Execute()
EndWith
oWord.Visible = .t. && if sending to printer maybe .f. and quit?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform