By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,643 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,643 IT Pros & Developers. It's quick & easy.

Any ideas how to Run Macro in Microsoft Publisher through PHP COM ?

P: n/a
my macro in Publisher changes "123" into "321" (example)
but I can't be able to run it.
This is how far I get throught with PHP & Publisher:

<?
$pub = new COM('publisher.application') or die('Unable to load
Publisher');
print "Loaded Publisher, version {$word->Version}\n";

$pub->Open('xxx.pub');

$pub->Documents[1]->SaveAs('xxx2.pub');

$pub = null;

?>

this works, but of course does not do anything else than open xxx.pub
and save it as xxx2.pub. I am trying to run my macro:

$pub->Documents[1]->RunMacro(replaceme);

where replaceme is my macro. I tried different variations:

$pub->Documents[1]->Run(replaceme);
$pub->Documents[1]->Application->Run(replaceme),

etc but no luck so far :(

Jan 26 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.