473,395 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

COM & Word

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
1 2058
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
3
by: Bishman | last post by:
Hi, I have some issues with the code below. These are: ONE: In code I open an existing document and 'attach' the Mail Merge data source, but the data is not poulating the merge fields...
2
yayh
by: yayh | last post by:
Dear all i tried this fine artical which guide you to write php code to create ms office file using COM. http://web.informbank.com/articles/technology/php-office-documents.htm the problem...
19
by: arnuld | last post by:
this programme runs without any error but it does not do what i want it to do: ------------- PROGRAMME -------------- /* K&R2, section 1.6 Arrays; Exercise 1-13. STATEMENT: Write a program...
8
by: Bllich | last post by:
hello, I have winForm app and I have some text and pictures that I want to save into a word file when I read it from a database. I don't know how many text or pictures do I have for one value in...
7
by: Army1987 | last post by:
Is this OK? If not, why? #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXLEN 32767 #define DIGITS 5 /* number of decimal digits in MAXLEN */ int main(void) { size_t i;
9
by: JFS | last post by:
I know most of you have probably read "The C Programming Language" (K&R) at some point. Well here is something that is driving me crazy. The exercises are impossible (most of them) for me to do....
0
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and ...
4
by: arnuld | last post by:
This program follows from the section 6.5 of K&R2 where authors created a doubly-linked list using a binary-tree based approach. The only thing I have rewritten myself is the getword function. I am...
2
by: bordogoy | last post by:
#include<string.h> #include<conio.h> #include<stdio.h> char*getName(int num) { char word; switch (num) { case 1:strcpy(word,"one");break; case 2:strcpy(word,"two");break;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.