Koen_V has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone,

I am trying to acces a Word document that is running on another PC. I use the Win32::OLE module for this.

The following line of code works well when I run my script locally :

my $word = Win32::OLE->GetActiveObject('Word.Application');
But it doesn't work when I add an IP address from another PC :
my $word = Win32::OLE->GetActiveObject(['10.1.5.35','Word.Application' +]);
The error message here reads " Bad string reference ". Did I make some kind of syntax error here ? I can't be that far off because the following line works just fine :
$word = Win32::OLE->new(['10.1.5.35','Word.Application']);

2005-02-28 Janitored by Arunbear - added code tags, as per Monastery guidelines

Replies are listed 'Best First'.
Re: Win32::OLE question
by davidj (Priest) on Feb 28, 2005 at 14:13 UTC
    I did a quick read of the Win32::OLE documentation. Apparently what you are trying to do is not possible. The GetActiveObject method will not accept an IP address, only the program and id. Personally, I think this is odd since one can create an object on a remote machine. Accordingly, you would think that one should be able to access an object on a remote machine. Mind you, I only did a quick read and I may have missed something. You might want to take a look at the documentation yourself. Win32::OLE

    davidj
Re: Win32::OLE question
by jdporter (Paladin) on Feb 28, 2005 at 14:15 UTC
    No, sorry. Unlike CreateObject (aka. new), GetActiveObject doesn't support remote access.
      Ok, thanks for the quick reply

      Koen
      Is there another way to get to a Word document on another PC ?

      I read something about a pointer moniker which can refer to a remote object but I can't find any examples on how to use this .