[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

V.Balaji

7/8/2008 11:21:00 AM


Hi Friends,

I am trying to print word document in the server using vb.net and we are using following code to do so.

Dim WordApp As New Word.Application
WordApp.Documents.Open(strFullPath, , , , , , , , , , , , , , )
WordApp.Documents(1).PrintOut(, , , , , , , bv_CopiesNum, , , False, , bv_PrinterName, False, False, False, False, False)
WordApp.Documents(1).Close()
WordApp.Application.Quit()

Here the problem is sometime when the system is restarted this donsen't work and we get exception from the word.exe as

"Word cannot print. There is no printer installed"

Any workaround or solution is highly appricated.

Thanks in advance.

Regards,
V.Balaji
iInterchange Systems Pvt. Ltd.,
Chennai | Tamil Nadu | India.
3 Answers

Patrice

7/8/2008 12:24:00 PM

0

What kind of server application is this ? ASP.NET ? Does it happen when no session is opened server side ?

You could install a printer in the default profile (the problem being that there is no printer installed for the service account you are likely using, if I remember the profile is not even loaded for this account, it is created from the default user profile so adding a printer there could solve the problem). I don't find the KB article right now.

AFAIK this is really not recommended (for example if the doc is marked with read only suggested, it will raise a dialog that will block furhter operations). You may want to give the big picture for alternate sugestiosn (for example AFAIK you can expose printers using http so that a user could print from its pc over internet on your printer). If this is to convert to another format such as PDF one could sugegst an alternate soltuino etc...

--
Patrice

"V.Balaji" <vba@iinterchange.com> a écrit dans le message de groupe de discussion : eDpgKzO4IHA.4908@TK2MSFTNGP04.phx.gbl...

Hi Friends,

I am trying to print word document in the server using vb.net and we are using following code to do so.

Dim WordApp As New Word.Application
WordApp.Documents.Open(strFullPath, , , , , , , , , , , , , , )
WordApp.Documents(1).PrintOut(, , , , , , , bv_CopiesNum, , , False, , bv_PrinterName, False, False, False, False, False)
WordApp.Documents(1).Close()
WordApp.Application.Quit()

Here the problem is sometime when the system is restarted this donsen't work and we get exception from the word.exe as

"Word cannot print. There is no printer installed"

Any workaround or solution is highly appricated.

Thanks in advance.

Regards,
V.Balaji
iInterchange Systems Pvt. Ltd.,
Chennai | Tamil Nadu | India.

V.Balaji

7/8/2008 12:52:00 PM

0

Hi Patrice,

Thanks for immediate reply, This is a service written in vb.net which takes the document from a folder in server and prints it. This is from an application when the users give print it takes the file and print from the server. Printers are installed in server.

Thanks and Regards,
Regards,
V.Balaji
iInterchange Systems Pvt. Ltd.,
Chennai | Tamil Nadu | India.

"Patrice" <http://www.chez.com/s... wrote in message news:5F26DDF8-AEFE-4E68-9421-32CD41B86428@microsoft.com...
What kind of server application is this ? ASP.NET ? Does it happen when no session is opened server side ?

You could install a printer in the default profile (the problem being that there is no printer installed for the service account you are likely using, if I remember the profile is not even loaded for this account, it is created from the default user profile so adding a printer there could solve the problem). I don't find the KB article right now.

AFAIK this is really not recommended (for example if the doc is marked with read only suggested, it will raise a dialog that will block furhter operations). You may want to give the big picture for alternate sugestiosn (for example AFAIK you can expose printers using http so that a user could print from its pc over internet on your printer). If this is to convert to another format such as PDF one could sugegst an alternate soltuino etc...

--
Patrice

"V.Balaji" <vba@iinterchange.com> a écrit dans le message de groupe de discussion : eDpgKzO4IHA.4908@TK2MSFTNGP04.phx.gbl...

Hi Friends,

I am trying to print word document in the server using vb.net and we are using following code to do so.

Dim WordApp As New Word.Application
WordApp.Documents.Open(strFullPath, , , , , , , , , , , , , , )
WordApp.Documents(1).PrintOut(, , , , , , , bv_CopiesNum, , , False, , bv_PrinterName, False, False, False, False, False)
WordApp.Documents(1).Close()
WordApp.Application.Quit()

Here the problem is sometime when the system is restarted this donsen't work and we get exception from the word.exe as

"Word cannot print. There is no printer installed"

Any workaround or solution is highly appricated.

Thanks in advance.

Regards,
V.Balaji
iInterchange Systems Pvt. Ltd.,
Chennai | Tamil Nadu | India.

Patrice

7/8/2008 1:06:00 PM

0

So the user asks to print a document in an application which then copy the file to a folder where a service gets the file and prints it server side ?

Couldn't the application directy print the file on a network printer ? Is this a problem to expose those printers on your network ?

Else if you still follow the the KB article I was thinking about is :
http://support.microsoft.com/kb/18... (it shows add to add pritner tot the default account so that a service account have those printers)

--
Patrice

"V.Balaji" <vba@iinterchange.com> a écrit dans le message de groupe de discussion : uc2UAmP4IHA.4988@TK2MSFTNGP04.phx.gbl...
Hi Patrice,

Thanks for immediate reply, This is a service written in vb.net which takes the document from a folder in server and prints it. This is from an application when the users give print it takes the file and print from the server. Printers are installed in server.

Thanks and Regards,
Regards,
V.Balaji
iInterchange Systems Pvt. Ltd.,
Chennai | Tamil Nadu | India.

"Patrice" <http://www.chez.com/s... wrote in message news:5F26DDF8-AEFE-4E68-9421-32CD41B86428@microsoft.com...
What kind of server application is this ? ASP.NET ? Does it happen when no session is opened server side ?

You could install a printer in the default profile (the problem being that there is no printer installed for the service account you are likely using, if I remember the profile is not even loaded for this account, it is created from the default user profile so adding a printer there could solve the problem). I don't find the KB article right now.

AFAIK this is really not recommended (for example if the doc is marked with read only suggested, it will raise a dialog that will block furhter operations). You may want to give the big picture for alternate sugestiosn (for example AFAIK you can expose printers using http so that a user could print from its pc over internet on your printer). If this is to convert to another format such as PDF one could sugegst an alternate soltuino etc...

--
Patrice

"V.Balaji" <vba@iinterchange.com> a écrit dans le message de groupe de discussion : eDpgKzO4IHA.4908@TK2MSFTNGP04.phx.gbl...

Hi Friends,

I am trying to print word document in the server using vb.net and we are using following code to do so.

Dim WordApp As New Word.Application
WordApp.Documents.Open(strFullPath, , , , , , , , , , , , , , )
WordApp.Documents(1).PrintOut(, , , , , , , bv_CopiesNum, , , False, , bv_PrinterName, False, False, False, False, False)
WordApp.Documents(1).Close()
WordApp.Application.Quit()

Here the problem is sometime when the system is restarted this donsen't work and we get exception from the word.exe as

"Word cannot print. There is no printer installed"

Any workaround or solution is highly appricated.

Thanks in advance.

Regards,
V.Balaji
iInterchange Systems Pvt. Ltd.,
Chennai | Tamil Nadu | India.