Word document vs Outlook message

F

Frédéric Laurent

Hello,

In Outlook, there is an option that says that a user can use Microsoft
Word as create/modify a message.

Because this user have a .dot file in his startup directory, he gets
some functions that was not intend for Outlook.

How can I detect with VBA that a macro runs in a Word document and not
in an Outlook message? ThisDocument.Parent, Application.AddIns.Parent
and Application.Name always return "Microsoft Word" either if it's a
document or a message.

Thank you for your advices!

Frédéric Laurent


Bonjour,

Dans Outlook, il y a une option qui indique qu'un utilisateur peut
prendre Microsoft Word pour créer/modifier un message.

Mais si l'utilisateur a un fichier .dot dans son répertoire de
démarrage (rép. startup), il peut exécuter des fonctions qui ne sont
pas prévues pour Outlook.

Comment puis-je détecter, avec VBA, qu'une macro s'exécute dans un
document Word et non dans un message Outlook ? ThisDocument.Parent,
Application.AddIns.Parent et Application.Name retournent toujours
"Microsoft Word" peu importe que l'on soit dans un document ou dans un
message.



Merci pour vos conseils.

Frédéric Laurent
 
A

Anne Troy

normal.dot is the default template for Microsoft Word. Unless they've
changed it, email.dot is the default template for Outlook emails written
using Word, so there is no conflict of templates there.
*******************
~Anne Troy

www.OfficeArticles.com


Hello,

In Outlook, there is an option that says that a user can use Microsoft
Word as create/modify a message.

Because this user have a .dot file in his startup directory, he gets
some functions that was not intend for Outlook.

How can I detect with VBA that a macro runs in a Word document and not
in an Outlook message? ThisDocument.Parent, Application.AddIns.Parent
and Application.Name always return "Microsoft Word" either if it's a
document or a message.

Thank you for your advices!

Frédéric Laurent


Bonjour,

Dans Outlook, il y a une option qui indique qu'un utilisateur peut
prendre Microsoft Word pour créer/modifier un message.

Mais si l'utilisateur a un fichier .dot dans son répertoire de
démarrage (rép. startup), il peut exécuter des fonctions qui ne sont
pas prévues pour Outlook.

Comment puis-je détecter, avec VBA, qu'une macro s'exécute dans un
document Word et non dans un message Outlook ? ThisDocument.Parent,
Application.AddIns.Parent et Application.Name retournent toujours
"Microsoft Word" peu importe que l'on soit dans un document ou dans un
message.



Merci pour vos conseils.

Frédéric Laurent
 
F

Frédéric Laurent

I understand that but I created a new template that is set in the
C:\Program Files\Microsoft Office\OFFICE11\STARTUP directory (for
Office 2003).

So my own template is launched with both Word document and Outlook
message.

Thank you for your answer but I still ask the same question:
How can I detect with VBA that a macro runs in a Word document and not
in an Outlook message?

Frédéric Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top