Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Snarfing data from microsoft word

by t0mas (Priest)
on Sep 18, 2002 at 11:28 UTC ( [id://198792]=note: print w/replies, xml ) Need Help??


in reply to Snarfing data from microsoft word

You could use something like this:
#!/usr/bin/perl -w # Uses use strict; use Win32::OLE; use Win32::OLE::Const; # Create MSWord object and load constants my $MSWord = Win32::OLE->new('Word.Application', 'Quit') or die "Could not load MS Word\n"; my $wd=Win32::OLE::Const->Load($MSWord); # Open document (full path) my $doc = $MSWord->Documents->Open('c:\full\path\to\document.doc'); # Ask word to print the contents of a field named "TheFieldIWant" print $doc->FormFields("TheFieldIWant")->Result,"\n"; # Close document (without save) $doc->Close({SaveChanges=>$wd->{wdDoNotSaveChanges}});


/brother t0mas

Log In?
Username:
Password:

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

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

    No recent polls found