Page 1 of 1

use COM MS Publisher

Posted: Wed Aug 28, 2002 6:46 am
by jeroenhendriks2
Does anyone know how I can get the properties (File / Properties) from a Microsoft Publisher file by using it's COM-objects?

And I want to save a Microsoft Publisher document as a text-document (.txt) by using it's COM-objects. I only can save it as a rtf-document.


I have already got this code working:

$instance = new com("publisher.application");
$instance->Open("C:\\xxx.pub");
$instance->ActiveWindow->Visible = 0;
$instance->ActiveDocument->SaveAs("C:\\test.txt", 6, 0); // dont work...
$instance->ActiveDocument->Close();
$instance->Quit();
$instance->Release();
$instance = null;

Posted: Fri Sep 06, 2002 5:10 pm
by acidbox
once in publisher try this.

ALT+F11

then, F2