On Wed, 17 May 2000 10:10:42, "Colin Goldberg"
<[EMAIL PROTECTED]> wrote:

>I am trying to save a Word doc as HTML. The (input) document is found, but 
>no save occurs and no error message is seen. I have a Win NT 4.0 
>workstation, with Word 2000, and ActivePerl 5.005_03. Can you help?

I guess the SaveAs does actually work, but the file is not where you
expect it to be.  I assume Word writes it to your default document
directory (the one configured in the Options dialog).  If you want to have
the HTML file in the same directory as the DOC file, specify a full path
for the destination too.

-Jan

>#!/usr/bin/perl
>
>use strict;
>use Win32::OLE;
>use Win32::OLE::Const 'Microsoft Word';
>
>my $Word = Win32::OLE->new('Word.Application', 'Quit');
>$Word->{'Visible'} = 1;
>$Word->Documents->Open("C:\\Tools\\ActivePerl\\con\\scanned.doc") 
>    || die("Unable to open document ", Win32::OLE->LastError());
>
>$Word->ActiveDocument->SaveAs({
>    FileName => "scanned.htm",
>    FileFormat     => wdFormatHTML,
>    LockComments      => "False",
>    Password      => "",
>    AddToRecentFiles      => "False",
>    WritePassword      => "",
>    EmbedTrueTypeFonts      => "False",
>    SaveNativePictureFormat      => "False",
>    SaveAsAOCELetter      => "False",
>    SaveFormsData       => "False",
>    ReadOnlyRecommended        => "False",
>});


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to