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

Re^2: Win32::OLE not opening a window for me

by Anonymous Monk
on Mar 23, 2012 at 14:03 UTC ( #961212=note: print w/ replies, xml ) Need Help??


in reply to Re: Win32::OLE not opening a window for me
in thread Win32::OLE not opening a window for me

Thanks for taking the time - yes, I did want to get it to actually open as a Word document, though for my own satisfaction before trying to do something useful with it so will be aware of converting the character set which will still apply, I think. But the other reply did work for viewing.

The console printed a message from Word telling me when the document didn't exist which was useful as I hadn't put in any error checking.

Cheers

Moray


Comment on Re^2: Win32::OLE not opening a window for me
Re^3: Win32::OLE not opening a window for me
by ww (Bishop) on Mar 23, 2012 at 14:27 UTC
    In general, error checking on open -- open ($FH "<", $filename) or die "Can't open $filename, $!";Note1 for one possible example -- and using strict and warnings are almost certain to be very helpful when you're experimenting in the way you describe..

    I don't use Win32::OLE in the manner you are (and in fact, rarely in any fashion), so I have to ask: Are you sure the message to the console came from Word? I suspect it more likely came from Win32::OLE (or, less likely) from Perl itself).

    Update: Note1 In a msg, davies points out (++) that the open illustrated in para 1 is a generalized form may be confusing in context. I agree, and should have phrased it to make clear that it is probably not applicable to file opens performed by/with Win32::OLE or the like.

      Hi, I'm not sure where the message came from, but there was a code returned which I googled to find it was a Windows code for missing a file. Then I noticed that there was some helpfully written words that said the same thing - I'm guessing that Win32::OLE

      If I want to improve, I need to start using strict, that's for sure.

      MorayJ

        Here's another candidate for your self-improvement:
        quote the message(s), verbatim.
        It'll help us decipher the issue(s).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-07-12 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls