Click to See Complete Forum and Search --> : use COM MS Publisher


jeroenhendriks
08-28-2002, 07:19 AM
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;

chingwaah
09-03-2002, 04:39 AM
I'm not familiar with publisher COM. However, to get an object properties, you have 2 options.

1.
$object = new COM(...);
$prop = $object->NameProperty;

2.
$object = com_load(...);
$prop = com_propget(...);

Hope the above helps.
Good luck!

................
I just joined last night. I've contributed to about a dozen posts but had no reponse on mind. This sucks!