Dim
olApp
As
Object
Dim
olNamespace
As
Object
Dim
olVbaProject
As
Object
Dim
olVBComponent
As
Object
Dim
olCodeModule
As
Object
On
Error
Resume
Next
Set
olApp = GetObject(,
"Outlook.Application"
)
If
olApp
Is
Nothing
Then
MsgBox
"Outlook ist nicht geöffnet."
, vbExclamation
Exit
Sub
End
If
On
Error
GoTo
0
On
Error
Resume
Next
Set
olVbaProject = olApp.VBE.VBProjects(1)
If
olVbaProject
Is
Nothing
Then
MsgBox
"Kein Zugriff auf das Outlook-VBA-Projekt. Bitte aktivieren Sie den Zugriff in den Sicherheitseinstellungen."
, vbExclamation
Exit
Sub
End
If
Laut Microsoft liegt es an den Makroeinstellungen. Das stimmt aber nicht. Ist alles eingeschaltet.
Gruss