This might be too late and not address your problem, but I have had similar troubles moving from Word 2003 to 2010, in particular your code example flunks for me too. After some anguish I recorded a macro to open a file with Word 2010 - and there was one big difference from 2003. Seems Word 2010 wants to see just a file name proper in the Open(), with a change of working directory beforehand. Doing that works for me. Here's a crude example you might try, note I've assumed a full path for $oldfile with forward slashes only:

use Win32::OLE; $Win32::OLE::Warn = 3; eval {$word = Win32::OLE->GetActiveObject('Word.Application')}; die "Word not installed" if $@; unless (defined $word) { $word = Win32::OLE->new('Word.Application', sub {$_[0]->Quit;}) or die "Oops, cannot start Word"; } $word->Activate; $word->{visible} = 1; $oldfile =~ m!^(.+?)/([^/]+)$!; my $dir = $1 . '/'; my $name = $2; $word->ChangeFileOpenDirectory($dir); my $doc = $word->Documents->Open("$name"); ...

In reply to Re: win32::ole and MS Office 2010 over cgi by kenearle
in thread win32::ole and MS Office 2010 over cgi by wal77

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.