This is the shell cod
Public Function ShellEx(
ByVal sFile As String,
Optional ByVal eShowCmd As EShellShowConstants = essSW_SHOWDEFAULT,
Optional ByVal sParameters As String = "",
Optional ByVal sDefaultDir As String = "",
Optional sOperation As String = "open",
Optional Owner As Long = 0
) As Boolea
Dim lR As Lon
Dim lErr As Long, sErr As Lon
If (InStr(UCase$(sFile), ".EXE") <> 0) The
eShowCmd =
End I
On Error Resume Nex
If (sParameters = "") And (sDefaultDir = "") The
lR = ShellExecuteForExplore(Owner, sOperation, sFile, 0, 0, essSW_SHOWNORMAL
Els
lR = ShellExecute(Owner, sOperation, sFile, sParameters, sDefaultDir, eShowCmd
End I
If (lR < 0) Or (lR > 32) The
ShellEx = Tru
Els
' raise an appropriate error
lErr = vbObjectError + 1048 + l
Err.Raise lErr, , App.EXEName & ".GShell", sEr
ShellEx = Fals
End I
End Functio
This is the pdf print or email cod
Private Sub Form_Load(
Dim sFile As Strin
Dim Path As Strin
Dim strFile As Strin
Dim List As Strin
Dim LFile As Intege
PrintPDF1.Visible = Fals
Dir1.Path = "K:\newcatdwgs\
Path = Dir1.Pat
File1.Path = Dir1.Pat
File1.Pattern = "*.pdf
List = File1.ListCoun
If List = 0 The
En
End I
File1.ListIndex =
LFile = File1.ListInde
strFile = Path & "\" & File
Do While LFile <= List -
LFile = LFil
File1.ListIndex = LFil
strFile = Path & "\" & File
ShellEx strFile, essSW_HIDE, , , "print", Me.hWn
LFile = LFile +
If LFile > List - 1 The
En
End I
Loo
En
End Su
I use this to print about 200 .pdf to the default printer everyday however you can use the same basic code just change the "print" to email and put in your email criteria which is email provider specific. If you search their website you should be able to find sample code for that part