Search code examples
phpms-wordcom

use word printout in PHP


I'm using PHP COM to manipulate msword.

$word->PrintOut(false, empty, empty, empty, empty,....);

Some parameters/varables are "optional", but can't be set as null or "" or 0

Will throw error: Parameter 16: Type not match (translated)

I found someone using "System.Reflection.Missing.Value" in C# ("empty/not set")

but, how can I use this in PHP? or something simillar.

thanks

I want to use PrintOut in php with parameters.

https://learn.microsoft.com/en-us/office/vba/api/word.document.printout


Solution

  • I gave up again.

    use vba macro instead,and call it in php, put parameter after with ,

    $word->run('macro_to_printout', $copies);
    

    in word

    sub macro_to_printout(copies as integer)
    
    ...
    
    end sub
    

    more vba help than this, don't waste you time on php com