How can you get ASP/IIS Word application with IUSR_ComputerName to PrintOut to spooler or disk?
Lauching Word.Application inside of ASP/DLL's, which defaults the launching
user to IUSR_ComputerName (I debugged this). Everything works, can access
and manipulate all Word objects and methods, including .Save but the .PrintOut
(creating a post-script file to disk) method doesn't work.
Solutions that didn't work:
* Tried changing IIS's IUSR_ComputerName to another username that I know
has access to print drivers/ spooler. Not fixed.
* Tried changing both username's with Administrative access to write to disk
and have access to spoolers.
* Tried changing the "Spooler" service login to an administrative account
(instead of system account). Bad idea, doesn't work.
* Tried setting up Word.Application in DCOMCNFG.EXE with an administrative
account. Doesn't work-- now I can't print in Word with an interactive login.
* NOTE: I DID change the password to IUSR_ComputerName so I can log on to
the workstation interactively and make sure printer-drivers are accessible
for that account. This is OK.
* I've tried to access registry points on the "Default Printer" setting found
through an API call using the reference below-- and get information accurately
(meaning access to DRV file is fine), BUT when I try to access the GetProfileString
API (see below) it returns nothing even though I'm sure I set a default printer
for the IUSR account.
Declare Function EnumPrinters Lib "winspool.drv" _
Alias "EnumPrintersA" (ByVal flags As Long, ByVal name As String, _
ByVal Level As Long, pPrinterEnum As Long, ByVal cdBuf As Long, _
pcbNeeded As Long, pcReturned As Long) As Long
GetProfileString("windows", "device", "", sRet1, lngRet)
Public Declare Function GetProfileString Lib "kernel32" _
Alias "GetProfileStringA" (ByVal lpAppName As String, _
ByVal lpKeyName As String, ByVal lpDefault As String, _
ByVal lpReturnedString As String, ByVal nSize As Long) As Long
To question I need to answer:
* How do you get IIS's login-account (IUSR_ComputerName or other) to have
an active Word.Application.PrintOut command work. I'm doing a print-to-file
method for .PrintOut. I can "Save" the Word document so disk-access isn't
a process-- so I'm ruling out "spooler" problems as the cause.
* Anyone know how to get IIS's login-acount IUSR_ComputerName to get access
to the spooler?
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL