Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: M$ Word ole hyperlink

by 3dbc (Monk)
on Jan 31, 2017 at 22:34 UTC ( [id://1180724]=note: print w/replies, xml ) Need Help??


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

Yes, it exists.
- 3dbc

Replies are listed 'Best First'.
Re^5: M$ Word ole hyperlink
by pryrt (Abbot) on Jan 31, 2017 at 23:22 UTC

    "Yes, it exists." Weird, not sure why it's not working for you.

    Here's an alternative to my base64-encoded .docm: I added the document creation to the Win32::OLE commands. I also was reminded that $! doesn't get set by Win32::OLE; instead, use Win32::OLE->LastError().

    When I run that exact code, this is what I get. How does it compare to your output for the same code?

    inside second C:\temp\hyper2.docx here 1 Win32::OLE=HASH(0x478c00) inside http://google.com/ 1 Win32::OLE=HASH(0x4788b8) inside http://www.perlmonks.o +rg/ 2 Win32::OLE=HASH(0x478d98) second http://duckduckgo.com/ 2 Win32::OLE=HASH(0x478c00) second http://www.perlmonks.o +rg/
      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

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180724]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-24 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found