If you want to display it first, you'll need to use the Snapshot control on
an Access form, or just open the snapshot using the ShellExecute api:
http://www.mvps.org/access/api/api0018.htm
Using this, there is a print putton right on the viewer.
To print directly from Access code, you'll need to set a reference to the
Snapshot ActiveX control (This should happen automatically if you add the
control to a form, but you'll need to do it manually without the control.)
Also use the New keyword when instantiating an instance of the Snapshot
Viewer in memory to print:
Private Sub cmdSnap_Click()
Dim snp As New SnapshotViewer
Dim stThisFile As String
Dim stSnapFolder As String
stThisFile = stSnapFolder & lstSNPFiles.Value
snp.SnapshotPath = stThisFile
snp.PrintSnapshot False ' False hides the dialog
End Sub

Signature
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
> I am trying to open snp file programmatically and then print:
>
[quoted text clipped - 6 lines]
>
> Appreciate assistance!
EdwardH - 17 May 2005 10:57 GMT
Arvin
Have placed control on form as you suggest.
Am getting "Method 'Print Snapshot' of object 'ISnapshotViewer' failed" on
that line.
What have I done wrong?
> If you want to display it first, you'll need to use the Snapshot control on
> an Access form, or just open the snapshot using the ShellExecute api:
[quoted text clipped - 31 lines]
> >
> > Appreciate assistance!
Stephen Lebans - 18 May 2005 03:03 GMT
If you have placed an instance of the SNapshot ActiveX control on your
form then you do not need to create an instance of the object. Just do
something like
Me.THeNameOftheSnapshotCOntrol.SnapshotPath = stThisFile
Me.THeNameOftheSnapshotCOntrol.PrintSnapshot False
I have seen the SnapshotPath property cause the PrintSnapshot method to
fail when it is not properly formatted. Try something like:
stThisFile = "File://" & stSnapFolder & lstSNPFiles.Value
Make sure your stSnapFolder variable contains the full path to the
folder including the Drive character.
Finally the Snapshot interface exposes a property that shows whether the
file you have selected has actually finished loading onto the control.
' Load the file via the SnapshotPath property
Me.THeNameOftheSnapshotCOntrol.SnapshotPath = stThisFile
Do While Me.THeNameOftheSnapshotCOntrol.Object.ReadyState <>4
DoEvents
Loop
' Now you can ask the control to Print itself
Me.THeNameOftheSnapshotCOntrol.PrintSnapshot False
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
> Arvin
> Have placed control on form as you suggest.
[quoted text clipped - 44 lines]
> > >
> > > Appreciate assistance!
EdwardH - 18 May 2005 08:49 GMT
Many thanks - success!
> If you have placed an instance of the SNapshot ActiveX control on your
> form then you do not need to create an instance of the object. Just do
[quoted text clipped - 86 lines]
> > > >
> > > > Appreciate assistance!