|
-
Oct 6th, 2000, 03:35 PM
#1
Thread Starter
Junior Member
Hi,
I am using MS Access97. I can use the printdlg api to open up the Print dialog but i am unable to retrieve what printer the user selected & then get my report to print to that printer (probably using prtDevNames & prtDevMode properties). Here is the code i have that opens the print dialog but i am kinda a lost on what to do after the dialog has been open....any suggestions would be greatly appreciated....
Also how can i set the prtdevnames & prtdevmode properties back to the original way
CODE
----
Dim lngretVal As Long
Dim udtPrDlg As PrintDlg
With udtPrDlg
.lStructSize = Len(udtPrDlg)
.hwndOwner = frm.Hwnd
'set other struct members here
End With
lngretVal = PrintDlg(udtPrDlg)
DoCmd.OpenReport "tickets", acViewNormal, "ticketqry"
' The above line sends the report to the printer, but the default printer & not the one selected by the user.
-
Oct 6th, 2000, 04:28 PM
#2
Thread Starter
Junior Member
OK, I guess this has become too complicated....
Would anyone Instead know how to simply open the printers folder from Code...
-
Oct 6th, 2000, 06:41 PM
#3
Hyperactive Member
I'm not sure if this is what you need, but take a look.
Update: Sorry that is for Windows CE 
But take a look at this one.
Hope this helps.
[Edited by dsy5 on 10-06-2000 at 07:47 PM]
-
Oct 6th, 2000, 09:18 PM
#4
Hyperactive Member
Ok, I think I've found your solution! Try this code:
Code:
Shell ("rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL PrintersFolder")
-
Oct 6th, 2000, 09:33 PM
#5
Hyperactive Member
You also may be able to use this code for ideas on how to change the default printer using the registry.
You could maybe write to the registry with API to change it.
-
Oct 6th, 2000, 10:13 PM
#6
Member
http://www.vbapi.com/ref/p/printdlg.html should get you up and running with the PrintDlg API call. As I found out the hard way, the printer and print spooler API calls are nothing you want to tackle within VB on your own. Defining, receiving, unpacking, and repacking the data structures used in these calls is decidedly non-obvious and non-trivial.
John Fritch
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|