Print a word document from VB DLL

I want to print a Microsoft word document containing only Times New roman font from the hard disk to the deafult printer using VB code. This code will be executed on the NT server where Microsoft Word will not be installed. Are there any APIs or Printer object functions available to do this thing?
     Do also write the code if possible.

Thanks in advance
vikramarajAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
The only thing that can be done if Word isn't intalled on the computer, is to have a ready to print file (you have the "Print to file" option when you go to the print panel).
0
Jon_RaymondCommented:
If you can connect to another computer that does have word you could use a COM server written in VB to execute the Word processing from a VB client app on your NT server.
0
vikramarajAuthor Commented:
The NT Server will have access to only the printserver and no other machines. "emoreau" could you please elaborate on the solution once again and also how it can be achieved from VB code.

Maybe if no solution comes out then I can force the client to install Microsoft Word on NT server. Still is Word is installed can the document be printed directly to the printer spooler using COM objects?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Jon_RaymondCommented:
If you want to print a Word document I think at some point Word has to be opened and the document has to be printed from Word.  If you use emoreau's solution you would print to a file instead of a printer, and then send the file to the printer.
0
rondeaujCommented:
if you install word on the server you can use this code:

Create a ref to the excel object lib 8.0

Dim MyExcel as Excel.WorkSheet

set Myexcel = getobject(filename)
'this will not open the app

myexcel.print
0
vikramarajAuthor Commented:
Thanks rondeauj,
0
vikramarajAuthor Commented:
Thanks rondeauj,
This is what I was looking for and This solution work fine.
0
Éric MoreauSenior .Net ConsultantCommented:
You can now accept rondeauj's comment.
0
rondeaujCommented:
my answer
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.