Monday, August 10, 2009

print documents without opening MS Word C#

print documents without opening MS Word using C#


1. using namespace in aspx page :

" using System.Diagnostics; "

2. write this on any action control like Button, chkbox etc....

C# Code.....

string filePath = "D:\\Atit\\sample.doc";
ProcessStartInfo info = new ProcessStartInfo(filePath);
info.Verb = "Print";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(info);
Response.Write("printed !");

finally , build & run ur Apllcation......

No comments:

Post a Comment