
Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
When I insert MsgBox ActiveDocument.HasRoutingSlip in the macro, it comes up
false in an email (using Word as the editor) and in a word document opened
from word. I tried checking several other email properties, also to no
avail. Any other ideas? Thanks and blessings, Will
> > How can visual basic determine that a macro is being run from within an
> > email
> > (where Word is the editor) as opposed to being run from Word (not in
> > outlook)?
>
> Check the HasRoutingSlip property of the document
Helmut Weber - 15 Jun 2007 23:06 GMT
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

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Will - 16 Jun 2007 02:55 GMT
Bravo; as the English would say, Brilliant!!! Thanks and blessings, Will
> Hi Will,
>
[quoted text clipped - 14 lines]
> MsgBox "Word"
> End Sub