About report snapshots and Snapshot Viewer

What is a report snapshot?

A report snapshot is a file (.snp extension) that contains a high-fidelity copy of each page of a Microsoft Access report and that preserves the two-dimensional layout, graphics, and other embedded objects of the report.

What is Snapshot Viewer?

Snapshot Viewer is a program that you can use to view, print, and mail a snapshot, such as a report snapshot. Snapshot Viewer version 9.0 consists of a stand-alone executable program, a Snapshot Viewer control (Snapview.ocx), a help file, and other related files. By default, Snapshot Viewer is automatically installed by Microsoft Access 2000 the first time you create a report snapshot. You can also install Snapshot Viewer from the Setup program, or from a World Wide Web software download page located at the Microsoft Access Developer's Web site.

You can use the Snapshot Viewer control to view a snapshot from Microsoft Internet Explorer version 3.0 or later or from any application that supports ActiveX controls, such as Access or Microsoft Visual Basic for Applications.

Benefits of report snapshots and Snapshot Viewer

If you print and distribute reports to users inside or outside your organization, using report snapshots can save considerable time and money. Instead of photocopying and mailing printed Microsoft Access reports, you can electronically distribute and publish them using either electronic mail or a Web browser, such as Microsoft Internet Explorer. Your users can easily and quickly view the reports online and only print the report pages they need. This is especially useful when your reports contain color and images, such as charts and pictures.

Using report snapshots

You use Microsoft Access 2000 to create a report snapshot. However, you can view, print, store, publish, distribute, and archive a report snapshot without having an Access license by using a combination of Snapshot Viewer and other programs such as Windows Explorer, an electronic mail program, or a Web browser, such as Microsoft Internet Explorer.

Using report snapshots on the World Wide Web

There are two ways you can publish a report snapshot on the World Wide Web:

•	Create a link to the report snapshot using an HTML anchor tag on a Web page. For example:

<A HREF="http://Website/NWTraders/catalog.snp">Catalog report</A>

If you are using Microsoft Internet Explorer version 3.0 or later as your browser, when you click on the link, Internet Explorer does an in-place activation of the report snapshot and Snapshot Viewer in the Internet Explorer window. Other browsers open the report snapshot in a separate Snapshot Viewer window. In either case, Snapshot Viewer must be installed on the same computer as the browser. Therefore, it's a good idea to provide an additional link on the Web page to the software download page for Snapshot Viewer. Users who do not have Snapshot Viewer installed on their computers can then download and install Snapshot Viewer to view the report.

•	Embed the Snapshot Viewer control on the Web page using the HTML Object tag. For example:

<OBJECT ID="SnapshotViewer" WIDTH=640 HEIGHT=480

 CLASSID="CLSID:F0E42D60-368C-11D0-AD81-00A0C90DC8D9">

    <PARAM NAME="_ExtentX" VALUE="16722">

    <PARAM NAME="_ExtentY" VALUE="11774">

    <PARAM NAME="_Version" VALUE="65536">

    <PARAM NAME="SnapshotPath"

 VALUE="http://Website/NWTraders/catalog.snp">

    <PARAM NAME="Zoom" VALUE="0">

    <PARAM NAME="AllowContextMenu" VALUE="-1">

    <PARAM NAME="ShowNavigationButtons" VALUE="-1">

</OBJECT>

You can embed the Snapshot Viewer control using the Microsoft ActiveX Control Pad application and set the control parameters using the Control Pad's Object Editor.

You can only use this method with Internet Explorer version 3.0 or later. In this case, if Snapshot Viewer is not installed on the same computer as the browser, Internet Explorer automatically downloads the Snapshot Viewer ActiveX control (but not the entire Snapshot Viewer program).

Sending report snapshots in electronic mail

You can send a report snapshot in electronic mail by using Snapshot Viewer or Microsoft Access. You can also embed a report snapshot as an icon or as a file in an electronic mail message, using an electronic mail program that supports ActiveX controls, such as Microsoft Outlook or Microsoft Exchange. When you send report snapshots in electronic mail, it's a good idea to always include a link to the software download page for Snapshot Viewer. For more information on sending a report snapshot in an electronic mail message, click  [image].

Creating and distributing report snapshots

A typical business application creates and distributes reports not only on request, but also on a schedule according to regular business cycles, such as weekly stock-level reminders, monthly sales reports, or quarterly financial statements.

From Microsoft Access 2000, you can programmatically create and distribute report snapshots in several ways. For example:

•	Create a macro that uses the OutputTo action to export one or more reports in snapshot format to a Web server that you use to publish your reports. For more information, click  [image].

•	Create a macro that uses the SendObject action to mail a report to a mail recipient or distribution list. For more information, click  [image].

•	Create a Visual Basic for Applications program. For more information, click  [image].


Open a report snapshot

1	On the File menu, click Open.

2	In the Look In box, click the drive that contains the report snapshot.

3	In the folder list, double-click folders until you open the folder that contains the report snapshot.

For more information on items in the Open dialog box, click the question mark  [image]  at the top of the dialog box, and then click the item.

Note   To open one of the last several report snapshots you had open, on the File menu, click the file name.


View a report snapshot

•	Open the report snapshot. For more information, click  [image].

If you have more than one report snapshot open, select the desired Report Snapshot window to make it active or point to the Window menu and click the file name.

Notes

•	You can move around the current page by using the scroll bars or shortcut keys. For more information on shortcut keys, click  [image].

•	You can view the report at different magnifications. For more information, click  [image].

•	You can use the navigation buttons at the bottom of the Report Snapshot window to move between pages, or right-click on the Report Snapshot window, and select the First Page, Previous Page, Next Page, or Last Page commands.

•	You can go to a specific page in the report snapshot by typing in a number in the Specific Page box located in the middle of the navigation buttons.


View a report snapshot at different magnifications

1	Open the report snapshot. For more information, click  [image].

If you have more than one report snapshot open, select the desired Report Snapshot window to make it active or point to the Window menu and click the file name.

2	Right-click the Report Snapshot window.

3	Point to Zoom.

4	Click a magnification percentage, Fit, or Fill.

Notes

•	When you select Fit, Snapshot Viewer adjusts the magnification of the entire page to fit the window.

•	When you select Fill, Snapshot Viewer adjusts the magnification of the page to fill the window. If the report is in portrait orientation, the report width or short side of the page fits the window; If the report is in landscape orientation, the height or short side of the page fits the window.

•	You can switch between the magnification you selected and Fit by placing the pointer on the report snapshot, and then clicking when the pointer turns into a magnifying glass.


Print a report snapshot

1	Open the report snapshot. For more information, click  [image].

If you have more than one report snapshot open, select the desired Report Snapshot window to make it active or point to the Window menu and click the file name.

2	Click the print button  [image]  located to the right of the navigation controls at the bottom of the Report Snapshot window.

Tip   You can also right-click the Report Snapshot window and click Print.

3	Enter the settings you want in the Print dialog box.

•	Under Printer, specify a printer.

•	Under Print Range, specify all pages or a range of pages.

•	Under Copies, specify the number of copies and whether they should be collated.

For more information on items in the Print dialog box, click the question mark  [image]  at the top of the dialog box, and then click the item.

Note   In Microsoft Internet Explorer, if you want to print a report snapshot from a World Wide Web page, do not use the Print command on the File menu of the Internet Explorer menu bar. That Print command only prints the contents of the Web page, not each page of the report snapshot.


Send a report snapshot in electronic mail by using the Send command

1	Open the report snapshot. For more information, click  [image].

If you have more than one report snapshot open, select the desired Report Snapshot window to make it active or point to the Window menu and click the file name.

2	On the File menu, click Send.

Snapshot Viewer opens a new mail message and embeds the report snapshot as an icon in the mail message.

Notes

•	If the Send command isn't available, your mail program might not be properly installed, or might not support Messaging Application Programming Interface (MAPI). Check your program's documentation to confirm that it supports MAPI, and if so, try reinstalling the mail program to make the Send command available.

•	In Microsoft Access 2000, you can use either the Mail Recipient (as Attachment) subcommand on the Send To command on the File menu or the SendObject action in a macro to send a selected report as an icon in an electronic mail message. For more information on using the SendObject macro, click  [image].

•	You can embed a report snapshot as an icon in an e-mail message using any electronic mail program that supports ActiveX controls, such as Microsoft Outlook or Microsoft Exchange.

•	You can embed a report snapshot as a file in an e-mail message in any electronic mail program that supports in-place activation. For example, in an Outlook mail message, select the Object command on the Insert menu, click Create From File, and then type the report snapshot file name in the File text box or click Browse to search for the file.

When your mail recipients read the e-mail message, they can double-click the image to activate Snapshot Viewer in place and read the report.


Shortcut keys for report snapshots

Press	General operations
F1	To display Help information
SHIFT+F1	To display What's This help; after pressing SHIFT+F1, move the pointer to the menu command, dialog box option, or screen region, and then click the item
ALT+F4	To quit Snapshot Viewer or close a dialog box
CTRL+P	To open the Print dialog box
Press	View different pages
PAGE DOWN or  DOWN ARROW	To view the next page (when Fit is selected)
PAGE UP or UP ARROW	To view the previous page (when Fit is selected)
Press	Navigate in a report snapshot
DOWN ARROW	To scroll down in small increments
PAGE DOWN	To scroll down one full screen
CTRL+DOWN ARROW	To move to the bottom of the page
UP ARROW	To scroll up in small increments
PAGE UP	To scroll up one full screen
CTRL+UP ARROW	To move to the top of the page
RIGHT ARROW	To scroll to the right in small increments
END or CTRL+RIGHT ARROW	To move to the right edge of the page
CTRL+END	To move to the lower-right corner of the page
LEFT ARROW	To scroll to the left in small increments
HOME or CTRL+LEFT ARROW	To move to the left edge of the page
CTRL+HOME	To move to the upper-left corner of the page
Press	Window operations
CTRL+F6	To cycle between open windows
ALT+SPACEBAR	To display the Control menu
CTRL+F4	To close the active window


Create a report snapshot

Note   You can't create a report snapshot by using Snapshot Viewer.

1	Start Microsoft Access 2000.

2	In the Database window, click Reports under Objects, click the name of the report you want to export, and then on the File menu, click Export.

3	In the Save As Type box, click Snapshot Format (*.snp).

4	Click the arrow to the right of the Save In box and select the drive or folder to export to.

5	In the File Name box, enter the file name.

6	Click Save.

By default, the report snapshot is displayed in Snapshot Viewer. If this is the first time you are creating a report snapshot and you chose not to install Snapshot Viewer during Setup, Access automatically installs Snapshot Viewer for you.

Notes

•	The report snapshot is based on the recordset behind the report, including any current OrderBy or Filter property settings.

•	If the report contains a parameter query, Access first prompts you for the parameter values, then outputs the results.

•	You can also use the OutputTo action in a macro to export a report to snapshot format. For more information, click  [image].


Create a report snapshot with the OutputTo action and publish it to the Web

1	Start Microsoft Access 2000.

2	Create a macro with one or more OutputTo actions, one for each report you want to output in report snapshot format. For example:

       Create Snapshot Macro

Action	Argument	Value
OutputTo	Object Type	Report
	Object Name	Catalog
	Output Format	Snapshot Format
	Output File	\\Website\Inetpub\wwwroot\Webreports\Catalog.snp *
	Auto Start	No
* Output directly to the folder on the World Wide Web server.

3	On the home page of the Web site, do one of the following:

•	Create a link to each report snapshot using an HTML anchor tag. For example:

<A HREF="http://Website/WebReports/catalog.snp">Catalog report</A>

•	Embed the Snapshot Viewer control in an HTML Object tag using the Microsoft ActiveX Control Pad application and set the control parameters using the Control Pad's Object Editor (you can only use this method with Microsoft Internet Explorer version 3.0 or later). For example:

<OBJECT ID="SnapshotViewer" WIDTH=640 HEIGHT=480

 CLASSID="CLSID:F0E42D60-368C-11D0-AD81-00A0C90DC8D9">

    <PARAM NAME="_ExtentX" VALUE="16722">

    <PARAM NAME="_ExtentY" VALUE="11774">

    <PARAM NAME="_Version" VALUE="65536">

    <PARAM NAME="SnapshotPath"

 VALUE="http://Website/WebReports/catalog.snp">

    <PARAM NAME="Zoom" VALUE="0">

    <PARAM NAME="AllowContextMenu" VALUE="-1">

    <PARAM NAME="ShowNavigationButtons" VALUE="-1">

</OBJECT>

Notes

•	If the report is based on a parameter query, you will need to modify the macro to run it in a batch file. You can use the SendKeys action to pass the parameter information, or modify the report by removing the parameter query and using specific criteria.

•	You can also create a Visual Basic for Applications program to do the same task. For more information, click  [image].


Send a report snapshot in electronic mail by using the SendObject action

1	Start Microsoft Access 2000.

2	Create a macro with a SendObject action. For example:

       Send Snapshot Macro

Action	Argument	Value
SendObject	Object Type	Report
	Object Name	Summary of Sales by Quarter
	Output Format	Snapshot Format
	To	All Northwind Traders; Shareholders
	Cc
	Bcc
	Subject	Quarterly Sales report
	Message Text	This is our best quarter in years!
	Edit Message	No
Notes

•	Depending on how your electronic mail program was set up, you may not be able to send a report snapshot programmatically if the electronic mail program requires you to log on and enter information. For example, Microsoft Outlook can be installed to prompt you for a user profile at log on. Therefore, you may need to modify your electronic mail program.

•	You can also create a Visual Basic for Applications program to do the same task. For more information, click  [image].


Troubleshoot printing and viewing report snapshots

What do you need help with?

I can't open or create a report snapshot.

I get the World Wide Web page instead of the report when I print a report snapshot.

I can't send a report snapshot in electronic mail.


I can't open or create a report snapshot.

•	You may not have permission to the file or folder that contains the file. Check the permissions on the file or folder or contact your system administrator.

•	The report snapshot is too big and you don't have enough disk space. Reclaim more disk space so the complete report snapshot can be saved to your disk.

•	The file is not a report snapshot. A snapshot file has a file extension of .snp and must be in snapshot format. Verify that the file has the correct extension and is in report snapshot format (in Windows Explorer, right-click the file and select Properties; the Type should be "Snapshot File").

•	You don't have Snapshot Viewer installed. You can choose to install Snapshot Viewer during Setup. If necessary, Snapshot Viewer is automatically installed by Microsoft Access 2000 the first time you create a report snapshot, but you may not have created a report snapshot. You can also install Snapshot Viewer from a World Wide Web software download page located at the Microsoft Access Developer's Web site.

•	If you are attempting to open the report snapshot from a Web page, you may experience a connection or timeout problem while the report snapshot is being downloaded. Redisplay the Web page, or restart your Web browser to see if that fixes the problem.


I get the World Wide Web page instead of the report when I print a report snapshot.

If you are viewing a report snapshot from a World Wide Web page, don't use the Print command on the File menu. That Print command only prints the contents of the Web page, not each page of the report snapshot. Instead, use the print button  [image]  to the right of the navigation controls at the bottom of the window, or right-click the report snapshot, and then click Print.


I can't send a report snapshot in electronic mail.

•	If the Mail Recipient (as Attachment) subcommand on the Send To command on the File menu isn't available, your electronic mail program might not be properly installed, or it might not support Messaging Application Programming Interface (MAPI). Check your program's documentation to confirm that it supports MAPI, and if so, try reinstalling the electronic mail program to make the Send To command available.

•	Depending on how your electronic mail program was set up, you may not be able to send a report snapshot programmatically if the electronic mail program requires you to log on and enter information. For example, Microsoft Outlook can be installed to prompt you for a user profile at log on. Therefore, you may need to modify your electronic mail program.


Web browser not installed

The World Wide Web page can't be displayed because a Web browser cannot be found. You must install a Web browser (for example, Microsoft Internet Explorer) before you can see this Web page. You must also make sure you have access to the Internet through a modem or network connection.


No Help topic is associated with this item.


Restore (Control menu)

Restores a window to its previous size and location.


Move (Control menu)

Activates the arrow keys on the keyboard so you can change the location of the program or window by pressing the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW key.


Size (Control menu)

Activates the arrow keys on the keyboard so you can change the size of the program or window by pressing the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW key.


Maximize (Control menu)

Enlarges a program or window to fill the screen. To restore the window to its previous size and location, double-click the title bar, or click Restore.


Close (Control menu)

Exits Snapshot Viewer or closes the active Report Snapshot window.


Open (File menu)

Opens an existing report snapshot.


Close (File menu)

Closes the active Report Snapshot window.


Print (File menu)

Prints the current report snapshot. Displays the Print dialog box first so you can change printer settings and properties.


Send (File menu)

Sends the current report snapshot through your electronic mail program.


1, 2, 3, 4 (File menu)

Lists most recently used report snapshots. To open a report snapshot from the list, click it.


Exit (File menu)

Ends the Snapshot Viewer session.


Status Bar (View menu)

Toggles between displaying and hiding the status bar at the bottom of the Snapshot Viewer window.


New Window (Window menu)

Opens the current report snapshot in a new window, which becomes the active window.


Cascade (Window menu)

Arranges Report Snapshot windows in an overlapping pattern so that the title bar of each window remains visible.


Tile (Window menu)

Arranges Report Snapshot windows as horizontal panes so that all windows are visible and don't overlap.


Arrange Icons (Window menu)

Arranges all icons of minimized Report Snapshot windows into rows across the bottom of the Snapshot Viewer window.


1, 2, 3...9 (Window menu)

Lists all visible Report Snapshot windows. To bring a window to the front, click it.


Help (Help menu)

Provides Help topics to help you accomplish your tasks. You can display Help contents organized by category, use an alphabetized index, or search for a specific topic.


About Snapshot Viewer (Help menu)

Provides version and copyright information about Snapshot Viewer.


First Page button

Moves to the first page of the report.


Previous Page button

Moves to the previous page of the report.


Next Page button

Moves to the next page of the report.


Last Page button

Moves to the last page of the report.


Specific Page box

Use to move to a specific page of a report snapshot by entering the page number.


Status Bar

On the left, displays actions of menu commands. On the right, displays CAP, NUM, or SCRL if the Caps Lock, Num Lock, or Scroll Lock keys are on.


Minimize (Control menu)

Reduces the window to an icon. To restore the window to its previous size and location, double-click the icon.


Next (Control menu)

Makes the next window in the sequence of open report snapshot windows the active window.


Fill

A report magnification that fills the Report Snapshot window in the following way: If the report is in portrait orientation, the report width or short side of the page fits the window; If the report is in landscape orientation, the height or short side of the page fits the window.


report snapshot

A file (.snp extension) that contains a high-fidelity copy of each page of a Microsoft Access report and that preserves the two-dimensional layout, graphics, and other embedded objects of the report.


Snapshot Viewer

A program that you can use to view, print, and mail a snapshot, such as a report snapshot. Snapshot Viewer version 9.0 consists of a stand-alone executable program, a Snapshot Viewer control (Snapview.ocx), and other related files. You can install Snapshot Viewer when you install or reinstall Microsoft Access 2000. By default, it is automatically installed by Microsoft Access 2000 the first time you create a report snapshot. You can also install Snapshot Viewer from the World Wide Web software download page located at the Microsoft Access Developer's Web site.


Snapshot Viewer control

An ActiveX control (Snapview.ocx) that you use to view a snapshot report from Microsoft Internet Explorer version 3.0 or later, or from any application that supports ActiveX controls, such as Microsoft Access or Microsoft Visual Basic.


AllowContextMenu Property

You can use the AllowContextMenu property to specify or determine whether the Snapshot Viewer control pop-up menu appears when you right-click the control or when you press the context menu on a Microsoft Windows keyboard.

Setting

The AllowContextMenu property uses the following settings.

Setting	Description	Visual Basic
Yes	(Default) The control's pop-up menu is displayed when you right-click the control.	True (–1)
No	The control's right-click menu is not displayed.	False (0)
You can set the AllowContextMenu property by using the control's property sheet or Visual Basic for Applications.

Remarks

When this property is set to Yes, the pop-up menu that is displayed when you right-click a Snapshot Viewer control contains commands to specify the control's Zoom property setting or navigate between pages in the snapshot. The pop-up menu also includes choices to print one or more pages of the current snapshot.

When this property is set to No, the pop-up menu will not appear when you right-click the control. You can still toggle between the Fill and Full Zoom property settings by clicking directly on the snapshot displayed in the control. You can navigate to other pages in the snapshot or print the snapshot by using the buttons at the bottom of the snapshot control. In addition, you can print a snapshot by using the Print button to the right of the navigation controls.

The Snapshot Viewer control does not support the ShortcutMenuBar property.


CurrentPage Property

You can use the CurrentPage property to specify or determine the page number of the page displayed in the Snapshot Viewer control.

Setting

The CurrentPage property setting is a Long Integer value representing a page number in a snapshot.

You can use this property only in Visual Basic for Applications.

Remarks

If you set this property to an invalid page number, load an invalid file type, or try to access it while the ReadyState property is less than 4, then an error will occur.


CurrentPage, PageCount Properties Example

The following example shows how to use the CurrentPage and PageCount properties to navigate to a page within a snapshot file.

Sub Navigate()

Dim lngPageNum As Long

Dim snpCtl As SnapshotViewer

Set snpCtl = Me.SnapShot1.Object

lngPageNum = InputBox("Enter snapshot page to display")

If IsNumeric(lngPageNum) And Len(lngPageNum) > 0 Then

If lngPageNum <= snpCtl.PageCount Then

snpCtl.CurrentPage = lngPageNum

Else

Msgbox "Please enter a value between 1 and " _

& snpCtl.PageCount

Exit Sub

End If

End If

End Sub


Error Property

You can use the Error property to determine if an error occurred while loading or printing a snapshot.

Setting

The Error property setting is a Long Integer value representing the error that occurred while trying to load a snapshot file.

The Error property is read-only and is available only by using Visual Basic for Applications.

Remarks

When you finish loading a snapshot, you can check this property to determine if any errors occurred. If the Error property is 0, then no error occurred.

The following table contains a description of the errors that may occur while opening a snapshot file.

Error	Description
2500	Invalid value.
2501	Invalid page.
2502	Missing or invalid snapshot file.
2503	Property is read-only.
2504	Operation canceled by user.
2505	You need a newer version of the Snapshot Viewer control to view this snapshot file.
2506	An error occurred while printing.
2507	An error occurred while opening a snapshot file.
2508	Out of memory.
2509	An error occurred writing to a temporary file while opening a snapshot file.
2510	You have no printer installed, or no printer has been selected as the default.


PageCount Property

You can use the PageCount property to determine the number of pages in a snapshot.

Setting

The PageCount property is a Long Integer value representing the number of pages in a snapshot.

The PageCount property is read-only and is available only by using Visual Basic for Applications.

Remarks

If you try to determine the PageCount property while no valid snapshot file is open, an error occurs.


ReadyState Property

You can use the ReadyState property to determine the status of the file being loaded into a snapshot control.

Setting

The ReadyState property is an Integer value representing the loading status of a snapshot file.

Setting	Description
0	The snapshot control has not been initialized.
1	The snapshot control is loading.
2	The snapshot control is loaded, but the snapshot file is being downloaded.
4	The snapshot control has finished downloading the snapshot file.
The ReadyState property is available only by using Visual Basic for Applications.

Remarks

If the SnapshotPath property has been set using the control's property sheet, then the ReadyState property will always be at least 2 even if the SnapshotPath property is later set to a zero-length string programmatically.

This property is useful when the SnapshotPath property contains an HTTP or FTP address to a snapshot file. In this case, the file is downloaded asynchronously and you can use the ReadyState property to determine when the download is complete and the snapshot is displayed.


Error, ReadyState, SnapshotPath Properties Example

The following example shows one way to use the Error, ReadyState, and SnapshotPath properties to load a snapshot file into a snapshot control. In this example, snpCtl is a variable representing a snapshot control on a form and strFilePath is the fully-qualified path to a snapshot file to be displayed.

Function LoadSnapshotFile(snpCtl As Object, strFilePath As String) As Boolean

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 snapshot file", _

vbOKOnly, "Snapshot Error = " & .Error

LoadSnapShotFile = False

End If

End With

End Function


ShowNavigationButtons Property

You can use the ShowNavigationButtons property to specify or determine whether navigation buttons are available in the Snapshot Viewer control.

Setting

The ShowNavigationButtons property uses the following settings.

Setting	Description	Visual Basic
Yes	(Default) The control's navigation buttons are displayed.	True (–1)
No	The control's navigation buttons are not displayed.	False (0)
You can set the ShowNavigationButtons property by using the control's property sheet or Visual Basic for Applications.

Remarks

When this property is set to No, the only way to navigate between pages in a snapshot is by using the snapshot control's pop-up menu or by setting the CurrentPage property using Visual Basic for Applications.


SnapshotPath Property

You can use the SnapshotPath property to specify or determine the path to the snapshot file to be displayed in the Snapshot Viewer control.

Setting

The SnapshotPath property is a String value representing the fully qualified path and file name to the snapshot file to be displayed in the control. The property can be set to the name of a snapshot file on a local computer, a file on a network, or a file located on at an HTTP or FTP address.

You can set the SnapshotPath property in the control's property sheet or by using Visual Basic for Applications.

Remarks

If you set the SnapshotPath property to a zero-length string or the name of a nonexistent file, then nothing is displayed in the control. If you set this property to the name of a file that is not a snapshot file, then a snapshot file icon with a red "X" is displayed in the control.

Because the control supports HTTP and FTP addresses, the control may not know if the SnapshotPath property is valid at the time it is set. You can use the ReadyState property to determine if a valid snapshot file has been loaded into the control.


Zoom Property

You can use the Zoom property to specify or determine the display state for a snapshot.

Setting

The Zoom property is an Integer value between 0 and 8 representing the display state for a snapshot page as a percentage of the actual page size.

Constant	Description
snapZoomToFit	(Default) Zooms to a full page display.
snapZoomToFill	Zooms the page to fill the available space in the control.
snapZoom200Percent	Zooms the page by a factor of 200%.
snapZoom150Percent	Zooms the page by a factor of 150%.
snapZoom100Percent	Zooms the page by a factor of 100%.
snapZoom75Percent	Zooms the page by a factor of 75%.
snapZoom50Percent	Zooms the page by a factor of 50%.
snapZoom25Percent	Zooms the page by a factor of 25%.
snapZoom10Percent	Zooms the page by a factor of 10%.
You can set the Zoom property in the control's property sheet or by using Visual Basic for Applications.

If you set this property to an invalid value, an error occurs.

Remarks

When the AllowContextMenu property is set to Yes, you can also specify the Zoom property from the control's pop-up menu.


AboutBox Method

The AboutBox method displays the About dialog box for the Microsoft Snapshot Viewer control.

Syntax

object.AboutBox

The AboutBox method has the following arguments.

Argument	Description
object	An object representing a Snapshot Viewer control.
Remarks

When you use the AboutBox method, the Microsoft Snapshot Viewer control About box is displayed.


FirstPage, LastPage, NextPage, PreviousPage Methods

The FirstPage, LastPage, NextPage, PreviousPage methods are used to navigate through the pages in a snapshot file.

Syntax

object.FirstPage

object.LastPage

object.NextPage

object.PreviousPage

These methods have the following arguments.

Argument	Description
object	An object representing a Snapshot Viewer control.
Remarks

These methods are used to move through the pages in a snapshot file. With one exception, executing these methods has the same effect as clicking the navigation buttons that are a part of the Snapshot Viewer control. The exception is that clicking the navigation buttons on the control will trigger the related FirstPage, LastPage, NextPage, or PreviousPage events, while navigating through pages programmatically does not trigger these events.

If the SnapshotPath property has no value or has an invalid value, using one of these methods will generate an error. You can use the ReadyState property to make sure the SnapshotPath is valid.

If you use the NextPage method while on the last page in a snapshot file, the last page in the file is displayed and no error occurs. If you use the PreviousPage method while on the first page in a snapshot file, the first page in the file is displayed and no error occurs.


PrintSnapshot Method

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

Syntax

object.PrintSnapshot([ShowPrintDialog As Boolean])

The PrintSnapshot method has the following arguments.

Argument	Description
object	An object representing a Snapshot Viewer control.
ShowPrintDialog	(Optional) A Boolean value specifying whether to show the Print dialog box. The default value is True.
Remarks

If you do not specify the optional ShowPrintDialog argument, then the Print dialog box is displayed. If the user clicks the Cancel button in the Print dialog box, an error (2504) occurs. If you use the PrintSnapshot method without having a snapshot file displayed in the control, an error (2502) occurs. You can use the SnapshotPath and ReadyState properties to make sure a valid snapshot is displayed in the control.

You can print one or more pages in a snapshot file by specifying the pages to print in the Print dialog box.

The PrintSnapshot method displays an hourglass while printing the snapshot file.


FirstPage, LastPage, NextPage, PrevPage Events

The FirstPage, LastPage, NextPage, PrevPage events occurs when the user clicks the Snapshot Viewer control navigation buttons or uses the control's pop-up menu.

Notes

•	These events have no arguments.

•	These events are triggered only when navigation occurs from the navigation buttons or the pop-up menu. They do not trigger when pages are navigated programmatically.


Progress Event

The Progress event occurs while a snapshot file is being loaded.

Syntax

Sub controlname_Progress(ByVal Amount As Long)

The Progress event has the following arguments.

Argument	Description
controlname	The name of the Snapshot control object.
Amount	An Integer value between 0 and 100 representing the percentage of the snapshot file that has been loaded.
Remarks

The SnapshotPath property can point to a snapshot file with an HTTP or FTP address. Depending on the size of the file and the speed of your Internet or intranet connection, it may take some time to download the complete file.

You can use the Amount argument of the Progress event to display a progress meter showing the status of the file download operation.

You can use the ReadyState propety to determine when a snapshot file has been completely loaded into the Snapshot Viewer control.


ReadyStateChange Event

The ReadyStateChange event occurs whenever a snapshot control's ReadyState property changes.

Syntax

Sub controlname_ReadyStateChange(ByVal ReadyState As Long)

The ReadyStateChange event has the following arguments.

Argument	Description
controlname	The name of the Snapshot control object.
ReadyState	An Integer value between 0 and 4 representing the current value of the ReadyState property.
Remarks

This event can by used to capture changes to the ReadyState property.


Error Property, PageCount Property, SnapshotPath Property, and ReadyStateChange Event Examples

The following example uses a Select Case statement in a Snapshot control's ReadyStateChange event procedure to determine the status of the ReadyState property. If a snapshot file is successfully loaded into the control, a message box is displayed showing file path and page count information. If an error occurs loading the snapshot, a custom error handling procedure is called to display information about the error that occurred. At the beginning of the procedure, constants are defined for each of the possible values for the ReadyState property.

Private Sub Snapshot1_ReadyStateChange(ByVal ReadyState As Long)

Const conSnpNotInitialized = 0

Const conSnpLoading = 1

Const conSnpStillDownloading = 2

Const conSnpDownloadComplete = 4

Select Case ReadyState

Case conSnpNotInitialized

' Snapshot control is not initialized.

Case conSnpLoading

' Snapshot control is loading.

Case conSnpStillDownloading

' Snapshot control is loaded, but the snapshot

' file is still downloading.

Case conSnpDownloadComplete

' Snapshot loading is complete.

With Snapshot1

If .Error = 0 Then

' Snapshot file successfully loaded into control.

Msgbox .SnapshotPath & _

" has been successfully loaded into the " _

& "Snapshot Viewer control." & vbCrLf & vbCrLf _

& "This snapshot file contains " & .PageCount _

& " pages."

Else

' An error occurred loading the snapshot file.

Call HandleSnapError(.SnapshotPath, .Error)

Exit sub

End If

End With

End Select

End Sub

Sub HandleSnapError(strFile As String, lngError As Long)

Dim strError As String

Select Case lngError

Case 2500

strError = "Error " & CStr(lngError) & ": Invalid value."

Case 2501

strError = "Error " & CStr(lngError) & ": Invalid page."

Case 2502

strError = "Error " & CStr(lngError) & _

": Missing or invalid snapshot file."

Case 2503

strError = "Error " & CStr(lngError) & _

": Property is read-only."

Case 2504

strError = "Error " & CStr(lngError) & _

": Operation canceled by user."

Case 2505

strError = "Error " & CStr(lngError) & _

": You need a newer version of the " _

& "Snapshot Viewer control to view this snapshot file."

Case 2506

strError = "Error " & CStr(lngError) & _

": An error occurred while printing."

Case 2507

strError = "Error " & CStr(lngError) & _

": An error occurred while opening a snapshot file."

Case 2508

strError = "Error " & CStr(lngError) & ": Out of memory."

Case 2509

strError = "Error " & CStr(lngError) & _

": An error occurred writing to a " _

& "temporary file while opening a snapshot file."

Case 2510

strError = "Error " & CStr(lngError) & _

": You have no printer installed, or no printer " _

& "has been selected as the default."

Case Else

strError = "Error " & CStr(lngError) & _

": An unknown error occurred."

End Select

MsgBox strError & " File: " & strFile

End Sub


OutputTo and SendObject Methods, Snapshot Object Type Examples

The following example outputs a snapshot file to disk or embedded in a mail message depending on the value supplied in the intOutputTO argument. There are two global constants defined in the declarations section of the module that are used to specify the type of output desired. If the intOutputTO argument contains the constant conSaveSnapshotToDisk, then the file is saved using the location and file name supplied in the strPath argument. If the intOutputTO argument contains the constant conSaveSnapshotToMail, then the file is embedded in a mail message addressed to the name supplied in the strRecipName argument. The strName argument is the name of a Report object in the current database. The strPath argument is the full path and file name representing the snapshot file to be saved to disk.

Const conSaveSnapshotToDisk As Integer = 1

Const conSaveSnapshotToMail As Integer = 2

Sub OutputSnapshotFile(intOutputTO As Integer, _

strName As String, Optional strPath As String, _

Optional strRecipName As String)

Dim strOutputFormat As String

DoCmd.Hourglass True

strOutputFormat = "Snapshot Format"

Select Case intOutputTO

Case conSaveSnapshotToDisk

If Len(strPath) > 0 Then

DoCmd.OutputTo acOutputReport, _

strName, strOutputFormat, strPath

Else

DoCmd.Hourglass False

Exit Sub

End If

Case conSaveSnapshotToMail

If Len(strRecipName) > 0 Then

DoCmd.SendObject acSendReport, _

strName, strOutputFormat, strRecipName

Else

DoCmd.Hourglass False

Exit Sub

End If

Case Else

End Select

DoCmd.Hourglass False

End Sub


Exporting Report Snapshots

There are two ways to programmatically export a report snapshot object from a Microsoft Access database.

•	You can use the SendObject method to embed a report snapshot in a mail message.

•	You can use the OutputTo method to save a report snapshot to disk.

The following table contains information about the first three arguments of the SendObject method used to send a report snapshot in a mail message. Note, only the first three arguments of the SendObject method are dicussed here as they are how you specify a report as a snapshot file. For information on the other arguments to the SendObject method, see that topic in the Microsoft Access on-line help.

Argument	Description
Object Type	A constant representing the type of object you want to send. For report snapshots this constant is: acSendReport.
Object Name	A string value representing the name of the report to include in the mail message as a snapshot file.
Output Format	To output a report snapshot, set this argument to the string value: "Snapshot Format".
The following table contains information about the first four arguments of the OutputTo method used to save a report snapshot to a snapshot file on disk. Note, only the first four arguments of the OutputTo method are dicussed here because they are how you specify that a report be saved to disk as a snapshot file. For information on the other arguments to the OutputTo method, see that topic in the Microsoft Access on-line help.

Argument	Description
Object Type	A constant representing the type of object you want to save to disk. For report snapshots this constant is: acOutputReport.
Object Name	A string value representing the name of the report to be saved to disk.
Output Format	To save a report snapshot, set this argument to the string value: "Snapshot Format".
Output File	A string value representing the full path and file name of the snapshot file you want to save to disk. For example: "c:\my documents\mysnapshot.snp"