offspinner has asked for the wisdom of the Perl Monks concerning the following question:
### PERL SCRIPTSub yadda() ' ' yaddaMacro ' Macro recorded 23/11/2004 by Richard Barrett-Small ' With Options .LocalNetworkFile = False .AllowFastSave = True .BackgroundSave = True .CreateBackup = False .SavePropertiesPrompt = False .SaveInterval = 10 .SaveNormalPrompt = False .DisableFeaturesbyDefault = False End With With ActiveDocument .ReadOnlyRecommended = False .EmbedTrueTypeFonts = False .SaveFormsData = False .SaveSubsetFonts = False .DoNotEmbedSystemFonts = True .Password = "" .WritePassword = "" .DisableFeatures = False .EmbedSmartTags = False .SmartTagsAsXMLProps = False .EmbedLinguisticData = True End With Application.DefaultSaveFormat = "" With autocorrect .CorrectInitialCaps = True .CorrectSentenceCaps = True .CorrectDays = True .CorrectCapsLock = True .ReplaceText = True .ReplaceTextFromSpellingChecker = True .CorrectKeyboardSetting = False .DisplayAutoCorrectOptions = True .CorrectTableCells = True End With With Options .LabelSmartTags = False .DisplaySmartTagButtons = True End With End Sub
#!C:\Perl\bin\perl5.8.4.exe use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; system("set PERL5OPT=-MWild"); my $file = $ARGV[0] or die "Perl says: $!\n\nThis means:\nSyntax is...\n\tpq_jnl_conv.pl filename(s)\n"; my $Word = Win32::OLE->new('Word.Application', 'Quit'); while ( $file = shift) { print "$file.html\n"; # $Word->{'Visible'} = 1; # if you want to see what's going on $Word->Documents->Open("$file") || die("Unable to open document $file\ +n", Win32::OLE->LastError()); $Word->ActiveDocument->SaveAs ( { FileName => "$file.html", FileFormat => FormatHTML } ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE Word Macro Conversion
by maa (Pilgrim) on Nov 24, 2004 at 13:11 UTC | |
by offspinner (Initiate) on Nov 24, 2004 at 15:03 UTC | |
by Jenda (Abbot) on Nov 25, 2004 at 00:46 UTC | |
by offspinner (Initiate) on Dec 01, 2004 at 12:18 UTC | |
by Jenda (Abbot) on Dec 01, 2004 at 13:47 UTC |