VBA Loop to Print All Snapshots Saved in a Folder

  • Thread starter Thread starter DoctorV3774 via AccessMonster.com
  • Start date Start date
D

DoctorV3774 via AccessMonster.com

I have the following code on a button in a form that automatically loads a
saved snapshot .snp file in my folder C:\Reports loads it into the snapshot
viewer control and prints it.

How can I extend this code so that it will load EVERY saved snapshot .snp
file in my C:\Reports folder print it close it go to the next print it close
it then end.
Thanks

*************CODE*********************

Dim stThisFile As String
Dim stsnapfolder As String

stThisFile = "C:\Reports\AnyReport.snp"
Me.THeNameOftheSnapshotCOntrol.SnapshotPath = stThisFile
Do While Me.THeNameOftheSnapshotCOntrol.Object.ReadyState <> 4
DoEvents
Loop
Me.THeNameOftheSnapshotCOntrol.PrintSnapshot True
 
I have the following code on a button in a form that automatically
loads a saved snapshot .snp file in my folder C:\Reports loads it into
the snapshot viewer control and prints it.

Check out help on the Dir() function; in particular the use of Dir() with
no parameters.


Tim F
 
Back
Top