: Friday, May 20, 2005 5:15 PM
Subject: Re: Microsoft Word search and replace issue That is a more efficient
way to do it; cycle through the collection.
Good call!
The problem here is that the document contains ActiveX controls and, as
noted, the only way to access ActiveX controls embedded
:
use Win32::OLE qw(in);
use Win32::OLE::Const 'Microsoft Word';
my $word = Win32::OLE-new('Word.Application');
$word-{visible} = 1;
my $doc = $word-{Documents}-Open(C:\\Word\\Certificate.doc);
and then
foreach my $shape (in $doc-Shapes) {
$shape-{TextFrame}-{TextRange}-{Text} =~ s
Hi all,
Further on this, I found I had to loop over all the Shapes in the Shapes
collection. eg:
use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Word';
my $word = Win32::OLE-new('Word.Application');
$word-{visible} = 1;
my $doc = $word-{Documents}-Open(C:\\Word\\Certificate.doc
'Microsoft Word';
my $word = Win32::OLE-new('Word.Application');
$word-{visible} = 1;
my $doc = $word-{Documents}-Open(C:\\Word\\Certificate.doc);
my $search = $doc-Content-Find;
my $replace = $search-Replacement;
$search-{Wrap} = wdFindContinue;
$search-{Text} = #tPreferredName#;
$replace-{Text} = Chris
Hi All,
I'm trying to write a basic perl script to open a Word document, change some
predefined values to something else.
It works fine on a basic document, but anything with text boxes it doesn't work
at all.
The script I run is:
use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft
I'm doing this to init the word object:
my $mswordapp = Win32::OLE-GetActiveObject('Word.Application')
|| Win32::OLE-new('Word.Application', 'Quit')
or die Can´t start Microsoft Word: .
Win32::OLE-LastError();
$mswordapp('word')-Documents-Open('myworddoc.doc')
or die
::OLE::Const ('Microsoft Word') ;
use IO::File ;
use LWP::UserAgent ;
use CGI ;
$Output = new CGI ;
$ua = new LWP::UserAgent ;
###
print $Output-header(-type='text/html',-expires='now');
print $Output-start_html
Get HTML-Kit, it uses HTML Tidy, works great and is easy to
configure (many options)
http://www.chami.com/html-kit/
Hermen
9-4-01 22:51:28, "Konstantin Naumov" [EMAIL PROTECTED]
wrote:
Hello!
How to clean up Word HTML?
I want to remove all "unnecessary" tags
Frodo
Hermen
has lots of paper in it.
4. Select all the word documents, right click, and select print
This wouldn't work because the documents were, with minor exceptions, NOT
Microsoft Word documents. What they largely were was C program files ending
with .c, .h, .ih, .mem, etc. -- plus some oddball other
push( @Dirs, $File ) if ( -d "$Dir\\$File");
print ".";
PrintMSWordFile ("$Dir\\$File") if ($File =~ /($FileSpec)$/i);
}
foreach $File (@Dirs) {
FindFiles("$Dir\\$File");
}
}
print &qu
ubject: RE: Printing Files via Microsoft Word
#
# This script will scan for MS Word files, through a specified path,
# and print them to the default printer.
#
SNIP
$Word-ActiveDocument-PrintOut({
Background = 0,
Range = wdPrintAllDoc
11 matches
Mail list logo