COM & Word

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Petey

    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_typeli b('Word.Applica tion');
    $word = new COM('word.appli cation') or die('Unable to load Word');
    print "Loaded Word, version {$word->Version}\n<b r/>";

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

    $output="";
    $word->ActiveDocume nt->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


  • kafooey

    #2
    Re: COM &amp; Word

    On Thu, 13 Nov 2003 17:41:52 -0000, "Petey" <peterNO@SP4Mdu sf.co.uk>
    wrote:
    [color=blue]
    >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.[/color]
    [color=blue]
    >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.[/color]

    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
    - kafooey@nospam. yahoo.co.uk
    - http://www.pluggedout.com/blog

    Comment

    Working...