This actually works.. Is there a way to set the path to save as? Or even better, after the page is open just save by it's self?
Code:Private Declare Function ShellExecute _ Lib "shell32.dll" _ Alias "ShellExecuteA" ( _ ByVal hwnd As Long, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Long) _ As Long Sub CommandButton1_click() Dim strFile As String Dim strAction As String Dim lngErr As Long mypath = "C:\Documents and Settings\My Documents\ECDs\" fname = Dir(mypath & TextBox1.Text & "_SPEC.pdf") If CheckBox1.Value = True Then If Len(fname) > 0 Then strFile = "C:\Documents and Settings\My Documents\ECDs\" & TextBox1.Text & "_SPEC.pdf" strAction = "OPEN" lngErr = ShellExecute(0, strAction, strFile, "", "", 0) Else ' find file from server and display strFile = "http://eic.mmci.com/eic_drw/qr/" & TextBox1.Text & "/" & TextBox1.Text & "_SPEC.pdf" strAction = "open" lngErr = ShellExecute(0, strAction, strFile, "", "", 0) End If End If End Sub




Reply With Quote
