in reply to Re^5: M$ Word ole hyperlink
in thread M$ Word ole hyperlink

Thanks again for your help and input, but I'm not sure exactly what you want me to do, which I'd be happy to do if I understood it. Just wanted to reiterate that I've gotten it to work thanks to this post and with the dependable help of the Perl Monks, whom thankfully I know I can always turn to when I'm in a perl jam because nobody else knows what the hell I'm talking about ;-)
- 3dbc

Replies are listed 'Best First'.
Re^7: M$ Word ole hyperlink
by pryrt (Abbot) on Feb 01, 2017 at 19:46 UTC

    I'm glad poj's other solution is working for you.

    Since you continued the discussion in this sub-thread after declaring the other solution as working, I assumed you still wanted to investigate my alternative. My further post was to provide a framework to further debug the issue, since my code worked exactly as I expected for me, but apparently didn't for you. If you're still interested, feel free to run the code and, if the results don't match mine, post your results.

    Whether or not you continue down my bunny trail, I suggest changing

    my $MSWord = Win32::OLE->new('Word.Application') or die $!; $MSWord->{'Visible'} = 1; my $doc = $MSWord->Documents->Open("c:/temp/Word.doc");
    ... to ...
    my $MSWord = Win32::OLE->new('Word.Application') or die Win32::OLE->La +stError(); $MSWord->{'Visible'} = 1; my $doc = $MSWord->Documents->Open("c:/temp/Word.doc") or die Win32::O +LE->LastError();

    ... because Win32::OLE routines do not set $!, so error messages are not seen using the original die $! call.

      That worked perfectly, Thanks so much! needed to change from double quotes to single quotes in the open file path string.
      - 3dbc