Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Word macro to code
Message
 
To
07/10/2008 17:04:49
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:
01353466
Views:
32
>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.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform