Click here to Skip to main content
15,882,802 members
Home / Discussions / C#
   

C#

 
AnswerRe: Transactions for non data related operations Pin
Not Active16-May-06 15:21
mentorNot Active16-May-06 15:21 
QuestionNewline in DataGrid Pin
Sean8916-May-06 14:06
Sean8916-May-06 14:06 
AnswerRe: Newline in DataGrid Pin
Nader Elshehabi16-May-06 15:42
Nader Elshehabi16-May-06 15:42 
GeneralRe: Newline in DataGrid Pin
Sean8916-May-06 15:47
Sean8916-May-06 15:47 
GeneralRe: Newline in DataGrid Pin
Josh Smith16-May-06 18:40
Josh Smith16-May-06 18:40 
GeneralRe: Newline in DataGrid Pin
leppie16-May-06 19:18
leppie16-May-06 19:18 
QuestionPrinting any file using Shell Pin
emran83416-May-06 13:44
emran83416-May-06 13:44 
AnswerRe: Printing any file using Shell Pin
Nader Elshehabi16-May-06 15:36
Nader Elshehabi16-May-06 15:36 
Hello, I've taken following code -as it is- from the MSDN documentation, just for the consistency, otherwise the problem is simple. For more information search in the index for "Process.StartInfo". Here you go:

void PrintDoc()
{
Process myProcess = new Process();

try
{
// Get the path that stores user documents.
string myDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
myProcess.StartInfo.FileName = myDocumentsPath + "\\MyFile.doc";
myProcess.StartInfo.Verb = "Print";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}
catch (Win32Exception e)
{
if(e.NativeErrorCode == ERROR_FILE_NOT_FOUND)
{
Console.WriteLine(e.Message + ". Check the path.");
}
else if (e.NativeErrorCode == ERROR_ACCESS_DENIED)
{
// Note that if your word processor might generate exceptions
// such as this, which are handled first.
Console.WriteLine(e.Message +
". You do not have permission to print this file.");
}
}
}

I Hope it will work for you.
GeneralRe: Printing any file using Shell Pin
emran83416-May-06 19:06
emran83416-May-06 19:06 
GeneralRe: Printing any file using Shell Pin
emran83418-May-06 0:09
emran83418-May-06 0:09 
GeneralRe: Printing any file using Shell Pin
Nader Elshehabi18-May-06 16:22
Nader Elshehabi18-May-06 16:22 
GeneralRe: Printing any file using Shell Pin
emran83418-May-06 16:48
emran83418-May-06 16:48 
GeneralRe: Printing any file using Shell Pin
Nader Elshehabi19-May-06 11:34
Nader Elshehabi19-May-06 11:34 
GeneralRe: Printing any file using Shell Pin
emran83419-May-06 21:52
emran83419-May-06 21:52 
GeneralRe: a question about SQL Pin
emran83420-May-06 20:03
emran83420-May-06 20:03 
GeneralRe: a question about SQL [modified] Pin
Nader Elshehabi21-May-06 11:27
Nader Elshehabi21-May-06 11:27 
GeneralRe: a question about SQL [modified] Pin
emran83425-May-06 13:13
emran83425-May-06 13:13 
AnswerRe: a question about SQL [modified] Pin
Nader Elshehabi28-May-06 5:05
Nader Elshehabi28-May-06 5:05 
GeneralRe: a question about SQL [modified] Pin
emran83428-May-06 18:09
emran83428-May-06 18:09 
AnswerRe: a question about SQL [modified] Pin
Nader Elshehabi29-May-06 13:22
Nader Elshehabi29-May-06 13:22 
QuestionHow to preserve line feed character in C# TextBox ? Pin
TinaQ16-May-06 12:53
TinaQ16-May-06 12:53 
AnswerRe: How to preserve line feed character in C# TextBox ? Pin
Office Lineman16-May-06 13:06
Office Lineman16-May-06 13:06 
AnswerRe: How to preserve line feed character in C# TextBox ? Pin
Christian Graus16-May-06 13:16
protectorChristian Graus16-May-06 13:16 
GeneralRe: How to preserve line feed character in C# TextBox ? Pin
TinaQ16-May-06 13:48
TinaQ16-May-06 13:48 
GeneralRe: How to preserve line feed character in C# TextBox ? Pin
Christian Graus16-May-06 14:00
protectorChristian Graus16-May-06 14:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.