Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can not print from MailMerge
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Can not print from MailMerge
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01352395
Message ID:
01352395
Views:
109
Hi everybody,

I'm getting this error from MailMerge
OLE IDispatch exception code 0 from Microsoft Word: Windows cannot print due to a problem with the current printer setup.
Try one or more of the following:
* Check the printer by printing a test page from Windows.
* Make sure the printer is turned on and online.
* Reinstall the printer driver...
I can print from Word on this printer OK. I can not figure out how to fix this problem and I really need this to be done!

The error comes on this line
objWordDoc.MailMerge.Destination = 0 && wdSendToPrinter = 1

	objWordDoc.MailMerge.Execute
	objWord.application.Options.PrintBackground = .f.
*-- get current active printer
	lcActivePrinter = objWord.application.ActivePrinter
*--  set active printer
	objWord.ActivePrinter = lcPrinter
	objWord.application.ActiveDocument.PrintOut() && Error here
*-- set current active printer back to original
	objWord.ActivePrinter = lcActivePrinter

	objWord.ActiveDocument.saveas(lcDocFileName1)
	objWord.ActiveDocument.close()
*--quit without saving any changes
	objWord.quit(0)
	=Sleep(1000)
commenting out playing with the printer doesn't help. Any other ideas how to make it work?

Also I tried to do mailmerge manually using the Word file and the generated Excel and can not make it work either.

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform