harish.svhk
New member
- Joined
- Sep 27, 2020
- Messages
- 1
- Programming Experience
- 10+
Good Morning Dean,
I am looking for this, to change the owner name of the print given through c# code, but for me it is showing only the owner name always as system logged in user.
Following are the code I am using to print from button click, but owner is always Administrator which is the logged in user of the computer.
Can you please help me here, appreciate your response either way.
Thank You
Harish
I am looking for this, to change the owner name of the print given through c# code, but for me it is showing only the owner name always as system logged in user.
Following are the code I am using to print from button click, but owner is always Administrator which is the logged in user of the computer.
Can you please help me here, appreciate your response either way.
Thank You
Harish
C#:
TrayName = "0";
PrinterName = "HP Ink Tank Wireless 410 series";
//PrinterName = "DIRECT-58-HP Ink Tank Wireless";
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
Document wordDoc = new Document();
object objBackground = true;
Object oMissing = System.Reflection.Missing.Value;
Object oTemplatePath = FilePath;
Object oNoOfCopies = 3;
wordApp.ActivePrinter = PrinterName;
wordDoc = wordApp.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = PrinterName;
pd.DocumentName = "Test Print...";
wordApp.UserName = "Harish";
wordApp.PrintOut(oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oNoOfCopies, oMissing, oMissing);
Last edited by a moderator: