Posted by kvram on 01/24/07 16:13
Hello !
I want to print the contents of a .RTF file to the screen.
I have the following code:
//========================================
<?php
$filename = "C:\\test\\1.rtf";
$word = new COM("Word.Application") or die("Unable to instantiate
Word");
$word->visible = true;
$word->Documents->Open($filename);
$word->ActiveDocument->PrintOut();
$word->ActiveDocument->Close();
$word->Quit();
?>
//========================================
I can access the file because i see it flashing by (in MS Word),
but later i'm given the option of saving it to .MDI format. (Microsoft
Document Imaging). So the question is about why ==>
$word->ActiveDocument->PrintOut();
doesn't simply output the contents of RTF on the screen?
I have a guess and that is: by default it is refering to the
printer device (file description 1?) . and in that case i tried
to redirect it to other file descriptors like 0 and 2. But non worked.
thanks for your time and suggesions,
kave
Navigation:
[Reply to this message]
|