Need an example of PrintSnapShot method

J

j

Could some please provide an example of the PrintSnapShot method? I would be
truly grateful.

Thanks,
J.
 
A

Alex Ivanov

Do you mean create snapshot?
DoCmd.OutputTo acOutputReport, "Report1", acFormatSNP, "c:\report.snp"
 
J

j

Alex...thank you very much for your reply. I have already successfully
created a module which exports the report to a .snp file similar to your code
below. However, what I am needing to do now is to automate the printing
process through the module or Windows to print the file to a virtual network
printer. I found the following, but I am having problems with the syntax.
If you have an example of this method, that would be great! I've searched
everywhere. I truly appreciate your assistance.

The PrintSnapshot method is used to print the current snapshot file.

object.PrintSnapshot ([ShowPrintDialog As Boolean])

The PrintSnapshot method has the following arguments.
 
A

Alex Ivanov

J,
You need to put the SnapshotViewer control on a form then you can call the
printsnapshot method of the control.

Private Sub Command1_Click()
SnapshotViewer1.SnapshotPath = "c:\report.snp"
SnapshotViewer1.PrintSnapshot
End Sub

If you have a newer version of the control (XP or possibly 2000), it has
also another printing method called PrintSnapshotDirect where you can supply
printerdriver, printername, and port as parameters so you are not tied to
the default printer.

Alternatively, you can use Windows API function ShellExecute with "print"
as the lpOperation parameter and path to the snapshot as lpFile, but I
recommend the first method, its easier and allows more control.

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal
hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal
lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long)
As Long
'....
ShellExecute 0,"print","c:\report.snp",vbnullstring,vbnullstring,0

HTH
--
Please reply to NG only. This email is not monitored.
Alex.


j said:
Alex...thank you very much for your reply. I have already successfully
created a module which exports the report to a .snp file similar to your
code
below. However, what I am needing to do now is to automate the printing
process through the module or Windows to print the file to a virtual
network
printer. I found the following, but I am having problems with the syntax.
If you have an example of this method, that would be great! I've searched
everywhere. I truly appreciate your assistance.

The PrintSnapshot method is used to print the current snapshot file.

object.PrintSnapshot ([ShowPrintDialog As Boolean])

The PrintSnapshot method has the following arguments.



Alex Ivanov said:
Do you mean create snapshot?
DoCmd.OutputTo acOutputReport, "Report1", acFormatSNP, "c:\report.snp"
 
J

j

Alex, this is oustanding! Thank you, so very much, for all of your help.

J.

Alex Ivanov said:
J,
You need to put the SnapshotViewer control on a form then you can call the
printsnapshot method of the control.

Private Sub Command1_Click()
SnapshotViewer1.SnapshotPath = "c:\report.snp"
SnapshotViewer1.PrintSnapshot
End Sub

If you have a newer version of the control (XP or possibly 2000), it has
also another printing method called PrintSnapshotDirect where you can supply
printerdriver, printername, and port as parameters so you are not tied to
the default printer.

Alternatively, you can use Windows API function ShellExecute with "print"
as the lpOperation parameter and path to the snapshot as lpFile, but I
recommend the first method, its easier and allows more control.

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal
hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal
lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long)
As Long
'....
ShellExecute 0,"print","c:\report.snp",vbnullstring,vbnullstring,0

HTH
--
Please reply to NG only. This email is not monitored.
Alex.


j said:
Alex...thank you very much for your reply. I have already successfully
created a module which exports the report to a .snp file similar to your
code
below. However, what I am needing to do now is to automate the printing
process through the module or Windows to print the file to a virtual
network
printer. I found the following, but I am having problems with the syntax.
If you have an example of this method, that would be great! I've searched
everywhere. I truly appreciate your assistance.

The PrintSnapshot method is used to print the current snapshot file.

object.PrintSnapshot ([ShowPrintDialog As Boolean])

The PrintSnapshot method has the following arguments.



Alex Ivanov said:
Do you mean create snapshot?
DoCmd.OutputTo acOutputReport, "Report1", acFormatSNP, "c:\report.snp"


--
Please reply to NG only. This email is not monitored.
Alex.


Could some please provide an example of the PrintSnapShot method? I
would
be
truly grateful.

Thanks,
J.
 
Top