Re: Check if macro running from email

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi Will,

couldn't find an elegant, bullet proof answer,
but maybe this is sufficient:

Sub Test4d()
Dim oCmd As CommandBar
Dim bOut As Boolean ' outlook true/false
For Each oCmd In Application.CommandBars
If oCmd.Visible = True Then
If oCmd.Name = "Envelope" Then
MsgBox "Outlook"
Exit Sub
End If
End If
Next
MsgBox "Word"
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

.