Anzeige
Archiv - Navigation
900to904
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
900to904
900to904
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

pdf.datei öffnen

pdf.datei öffnen
31.08.2007 09:21:00
Piet
Hallo,
wie kann ich mit einem Makro eine pdf-Datei öffnen?
gruß
Piet

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
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

Anzeige
AW: pdf.datei öffnen
31.08.2007 13:38:19
Piet
Hi Rainer,
funkzt einwandfrei, aber die geöffnete Datei bleibt unten in der Leiste liegen. Wie "aktiviert" man die jetzt?
Gruß
Piet

AW: pdf.datei öffnen
31.08.2007 14:41:07
Ramses
Hallo
steht alles im Code.
Ersetze die "6" in "parExe = ShellExecute(0&, "Open", strDatei, 0&, 0&, 6)" mit einer entsprechenden Zahl.
Einfach ausprobieren.
Gruss Rainer

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige