Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print with word viewer not word? 1

Status
Not open for further replies.

bn2hunt

MIS
May 15, 2003
203
US
I have been looking for information on printing a word document from a script without having word installed on a computer. Is it possible to print the document using word viewer or can I install the "Word.Application" on a pc without word installed on the computer?


bn2hunt

"Born to hunt forced to work
 
If it is Word6 with next to no pictures and no tables or section numbers, wordpad can handle it.
 
To print word document without word installation, you would find switching and familiaring openoffice rewarding in the long run.

As of the simplest commandline approach, using -p will do the basic.
[tt]soffice.exe -p <document.doc>[/tt]

But the more interesting and rewarding is that you can familiarizing with openoffice.org's automation interface doing automation. It is still a quite obscur area. For those familiar with python, there seems to be another plus. The automation is accessible from vbs. Here is what I figure for this minimal thing.
[tt]
[green]docfile="d:\xyz\abc.doc" 'your msword doc file[/green]

set osm=createobject("com.sun.star.ServiceManager")
set odesk=osm.createInstance("com.sun.star.frame.Desktop")
set odoc=odesk.loadComponentFromURL("file:///" & replace(docfile,"\","/"), "_blank", 0, array())

odoc.print array() 'main functional line of print
'give enough sleep here seems necessary
wscript.sleep 500
odoc.close true

set odoc=nothing
set odesk=nothing
set osm=nothing
[/tt]
Certainly for those without the commercial msoffice, one would anticipate a lot and hope for their success of those guys supporting the free OOo.
 
xwb, unfortunaltly the label has at least 2 tables on it so wordpad is not an option.

Tsuji, I will look into the open office option. I know we have been tsesting this product for use in our company so I should be able to get a copy fairly easy. The only thing I need to do that you didn't include in your example is send it to a specific printer. Is there and Documentation that comes with open office that pertains to the scripting components or will I need to search online for it.

Thanks for the posts



bn2hunt

"Born to hunt forced to work
 
The basic is surely from the origin of the tech OOo, the package, documentation and skd download. And then for developers, their api development site.

It is then tough to get started if one comes from ms/activex-affiliate. I find kalitech help the transition.

The there are OOo running forums where some excellent persons posting long articles on specific topics, for instance this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top