[AccessD] Snapshot Viewer Control

Greggs greggs at msn.com
Wed Dec 31 14:24:04 CST 2003


Thanks Juan... works like a champ.  Let me ask you something else.  I
noticed the 97 active x has a black background and the 2K has a green
background.  Anyway to change that?

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of MastercafeCTV
Sent: Monday, December 29, 2003 6:35 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Snapshot Viewer Control


Yes it so easy, we use a function to LOAD any SNP file over the control. See
the code

Function LoadSnapshotFile(snpCtl As Object, strFilePath As String) As
Boolean
    On Error Resume Next
    Const conSnpFinishedDownload As Integer = 4
    With snpCtl
        .SnapshotPath = strFilePath
        Do While .ReadyState < conSnpFinishedDownload
            DoEvents
        Loop
        If .Error = 0 Then
            LoadSnapshotFile = True
            Exit Function
        Else
            MsgBox "Error loading FILE Snapshot", _
                vbOKOnly, "Error Snapshot = " & .Error
            LoadSnapshotFile = False
        End If
    End With
End Function

On the form we put the SNAPSHOT control and ON OPEN, we send ARGS to the
main form with SNPFile (me.informe= SNP file) ( me.snaprep = Ctl Snapshot in
our Form)

Private Sub Form_Open(Cancel As Integer)
Me.informe = Me.OpenArgs
LoadSnapshotFile Me.SnapRep, Me.informe
End Sub

For create the SNP files we use another function, and this is very flexible
to send mail with this SNP

Sub OutputSnapshotFile(intOutputTO As Integer, strName As String, Optional
strPath As String, Optional strRecipName As String, Optional strSubject As
String, Optional strmessage As String)

    Dim strOutputFormat As String
    DoCmd.Hourglass True

    Select Case intOutputTO
        Case conSaveSnapshotToDisk
            If Len(strPath) > 0 Then
                DoCmd.OutputTo acOutputReport, strName, acFormatSNP, strPath
            Else
                DoCmd.Hourglass False
                Exit Sub
            End If
        Case conSaveSnapshotToMail
            If Len(strRecipName) > 0 Then
                DoCmd.SendObject acSendReport, strName, acFormatSNP,
strRecipName, , , strSubject, strmessage
            Else
                DoCmd.Hourglass False
                Exit Sub
            End If
        Case Else
    End Select
    DoCmd.Hourglass False
End Sub


Hope that this can help you. Good luck

Juan Menendez

===========================================
MASTERCAFE SL - NIF B-82.617.614
www.mastercafe.com
Deleg. Asturias
Tel 985.88.49.44 / 627.531.764
Fax 627.500.205
info at mastercafe.com
juan at mastercafe.com
Deleg. Madrid
Tel 627.474.285
cecilia at mastercafe.com
===========================================


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Greggs
Sent: lunes, 29 de diciembre de 2003 23:43
To: Access Developers discussion and problem solving
Subject: [AccessD] [AccessD ]Snapshot Viewer Control


I have inserted the Activex Snapshot Viewer Control into a form and can view
a snp file.  Is there any way I can change the file the viewer looks at
programmatically?

What I want to select the file from a list of snapshot files in a list box
or continuous form and have the Viewer show me the selected snapshot.  This
could be a very cool way to give the user a thumbnail of a report to see if
he is selecting the right report before he takes the time to preview or
print it.




_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list