By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 834 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

COM & Word

P: n/a
Hi there!

I am trying to print a document after merging some data into it using PHP
COM and it seems to be very tempremental and doesn't work at all over
network printers. When I say tempremental, if it works on a machine it
works, no question, but if it doesn't it just goes nowhere and doesn't say
anything at all.

Defintely works on Windows XP Pro, but again tempremental, once it wasn't
working and I did everything possible, all office updates etc. but gave up
and just re-installed windows and it worked fine.

Windows 2000, i think i've had it working

Windows 2000 Server, not working.

All using Office 2000, but even tried the Office 2003 on Windows 2000 Server
and nothing at all.. :( It seems very badly documented.

The code I use to print: (a simplified just to do the task)

<?

$empty = new VARIANT();
com_load_typelib('Word.Application');
$word = new COM('word.application') or die('Unable to load Word');
print "Loaded Word, version {$word->Version}\n<br/>";

$word->Documents->Open("c:/templates/Options.doc");

$output="";
$word->ActiveDocument->PrintOut(0,0,0,$output);

?>

Is there any known good resources for doing this? Can anyone shed any light
on this?!!
Any help will be grately appreciated!
Peter
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 13 Nov 2003 17:41:52 -0000, "Petey" <pe*****@SP4Mdusf.co.uk>
wrote:
I am trying to print a document after merging some data into it using PHP
COM and it seems to be very tempremental and doesn't work at all over
network printers. Defintely works on Windows XP Pro, but again tempremental, once it wasn't
working and I did everything possible, all office updates etc. but gave up
and just re-installed windows and it worked fine.


This is a complete shot in the dark, but have you looked at the DCOM
security settings on the machines that work and compared it with those
that dont?
kafooey
- ka*****@nospam.yahoo.co.uk
- http://www.pluggedout.com/blog
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.