Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Converting DOS-Word(5.5) to Winword(97)

by Spida (Acolyte)
on Oct 07, 2002 at 13:52 UTC ( [id://203324]=perlquestion: print w/replies, xml ) Need Help??

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

Is it possible to convert a file which was created with some 5.5 Version of M$-Word for DOS to an .doc file for M$-Winword 97 using Perl?
I have some 10000 files to convert, and I'm looking for a place to start researching.
Any pointers gladly accepted.
  • Comment on Converting DOS-Word(5.5) to Winword(97)

Replies are listed 'Best First'.
Re: Converting DOS-Word(5.5) to Winword(97)
by cacharbe (Curate) on Oct 07, 2002 at 14:07 UTC

    That converter comes with office, and can be installed when you install Word (which you will need to do). Make sure that it is installed, and then just open the document in word, save as Current Word document, rinse, repeat.

    Specifically, you are looking at using Win32::OLE. Here is some code to get you started:

    use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; $Win32::OLE::Warn = 3; my $Word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new('Word.Application', 'Quit'); my $docname; ##PUT AN EXAMPLE DOCNAME HERE $Word->{'Visible'} = 1; $Word->Documents->Open ($docname) or die"Unable to create document ".W +in32::OLE->LastError()."\n"; $Word->Documents->ActiveDocument->SaveAs({FileName=>'NEWFILENAME', FileFormat=>wdFormatDocument});

    C-.

    ---
    Flex the Geek

Log In?
Username:
Password:

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

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

    No recent polls found