|
VB 4/6- und VBA-Forum - Beitragsübersicht - |
|
Thema | VB6: Alternative |
Von |
Bollerkohl |
Datum |
03. August 2016 um 18:36:16 |
Frage |
Hallo Leute,
gibt es eine Möglichkeit alternativ zum Beispiel einen weiteren Pfad zu prüfen und zu öffnen? Hier mein Code:Private Sub cmd_Sales_PT_Click() Dim Result As Long, Buff As String Buff = "C:\Program Files\Microsoft Office\Office14\winword.exe" Or "C:\Program Files (x86)\Microsoft Office\Office14\winword.exe" Result = ShellExecute(0&, "Open", Buff, "", "", 1) If Result <= 32 Then MsgBox "Datei nicht vorhanden oder falschen Dateinamen - Winword.exe... " End Sub |
|
Antwort: |
Von |
Neptun |
Datum |
03. August 2016 um 20:58:40 |
Antwort |
Hallo Bollerkohl, probier's mal so: Dim Pfad1$, Pfad2$, Pfad3$ Pfad3 = "\Microsoft Office\Office14\winword.exe" Pfad1 = Environ$("ProgramW6432") & Pfad3 Pfad2 = Environ$("ProgramFiles") & Pfad3 If Dir$(Pfad1) <> "" Then Shell Pfad1, vbNormalFocus ElseIf Dir$(Pfad2) <> "" Then Shell Pfad2, vbNormalFocus Else MsgBox "Datei nicht gefunden.", vbOKOnly + vbExclamation End If Gruss,
Neptun |
|
[ Antwort schreiben | Zurück zum VB 4/6- und VBA-Forum | Forum-Hilfe ] |
|
Letzte Aktualisierung: Sonntag, 13. Dezember 2015 |
|