AW: pdf.datei öffnen
31.08.2007 09:37:00
Ramses
Hallo
probiers mal
Option Explicit
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
Function Call_Parent_Exe(strDatei As String)
'Die letzte Variable "Anzeigestatus" sollte in nummerischer Form erfolgen
'weil sie sonst bei TXT Dateien nicht funktioniert
'1 SW_HIDE Hides the window and activates the executable file.
'2 SW_MAXIMIZE Maximizes the window.
'3 SW_MINIMIZE Minimizes the window. The next top-level window in the Z-order is activated.
'4 SW_RESTORE Activates the window even if it is hidden or minimized
'5 SW_SHOW Activates the window and displays it in its original size and at its original position.
'6 SW_SHOWMAXIMIZED Activates the window. The window is displayed as maximized.
'7 SW_SHOWMINIMIZED Activates the window. The window is displayed as minimized.
'8 SW_SHOWMINNOACTIVE Activates the window as minimized. The active window retains the focus.
'9 SW_SHOWNA Activates the window in its current state but the active window retains the focus.
'0 SW_SHOWNOACTIVATE Displays the window in its most recent size and in its most recent position. The active window retains the focus.
'10 SW_SHOWNORMAL Displays the window in its original size and at its original position.
Dim parExe
parExe = ShellExecute(0&, "Open", strDatei, 0&, 0&, 6)
End Function
Sub test()
'Hier den Pfad zur Datei angeben
Call_Parent_Exe ("C:\demo.pdf")
End Sub
Gruss Rainer