Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net
Automating Office under a different username from .net Automating Office under a different username from .net
Automating Office under a different username from .net
Go Back  Xtreme Visual Basic Talk > > > Automating Office under a different username from .net


Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2011, 07:36 AM
humbug humbug is offline
Newcomer
 
Join Date: Sep 2011
Posts: 1
Question Automating Office under a different username from .net


Hi there,

I have used VB.NET and Microsoft Offices Interop to create an application that will run on a server and will print files for different users.

My problem is that I need to find a way to impersonate different users so that when MS Word opens and prints, the resulting print job is recorded under that user.

I found this link that lets you run .net code as a different user - unfortunately it doesn't work with this code. The username recorded is still the user that is logged on the server.

Edit: Code Removed by moderator. This topic is not allowed on this forum.


Any ideas how I can make the Office app I'm automating run under a different user to the .net program that is calling it?

Thanks!

Last edited by Gruff; 09-09-2011 at 09:52 AM.
Reply With Quote
  #2  
Old 09-09-2011, 08:30 AM
Deerchefoh Deerchefoh is offline
Newcomer
 
Join Date: Sep 2011
Location: Anthony
Posts: 1
Default

Hi everyone, interesting article
Reply With Quote
  #3  
Old 09-09-2011, 10:00 AM
Gruff's Avatar
GruffAutomating Office under a different username from .net Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Welcome to the forum humbug and Deerchefoh. Don't forget to read the forum Posting Guidelines.

Speaking of guide lines the forum does not permit topics that can be used for malicious purposes to be posted.

Humbug, If your users are using your new program to print using the server installed Office product it seems to me you could capture your user log-in names inside your new application from the Environ() method and record the names and datestamp for the print jobs on your server.

If you want to push out print jobs that have a group of user's names on the paperspace header then I would suggest using a different programming approach. That alters the print output directly.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T

Last edited by Gruff; 09-09-2011 at 10:10 AM.
Reply With Quote
Reply

Tags
automation, impersonate, office, vb.net


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net Automating Office under a different username from .net
Automating Office under a different username from .net
Automating Office under a different username from .net
 
Automating Office under a different username from .net
Automating Office under a different username from .net
 
-->