Frage zu Word Document aus Excel öffnen
10.11.2003 17:56:14
Sascha
wenn ich ein Word Document per Doppelklick aus dem Explorer starte und dabei die Shift-Taste gedrückt halte, werden die Makros nicht gestartet.
Diese Shift-Funktion möchte ich gerne in mein Makro einbauen. Kann mir jemand helfen?
Danke
Gruß Sascha
' gehört zum Makro Word öffnen
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 lpnShowCmd As Long) As Long
Public
Sub Word_öffnen()
Dim intIndex As Integer
With Application.FileSearch
.FileType = msoFileTypeWordDocuments
.LookIn = ThisWorkbook.Path
If .Execute > 0 Then
For intIndex = 1 To .FoundFiles.Count
ShellExecute 0, "open", Right(.FoundFiles(intIndex), InStr(1, StrReverse(.FoundFiles(intIndex)), "\") - 1), "", ThisWorkbook.Path & "\", 3
Next
End If
End With
End Sub