Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Parcourir toutes les bal dans outlook

1 réponse
Avatar
truc
Bonjour

J'ai 2 bals ouvertes dans outlook. Je voudrais faire une recherche dans les
inbox des 2 bals.
J'arrive bien à le faire pour la bal par defaut, celle lié au profil par
contre la seconde, je n'y arrive pas.

Quelqu'un aurait une solution ?

mon script vba :
Public Sub Mail()
Set app = CreateObject("Outlook.Application")
Set ns = app.GetNamespace("MAPI")
Set folder = ns.GetDefaultFolder(olFolderInbox)
Set msgs = folder.Items
For Each msg In msgs
myText = msg.Body
If InStr(myText, "toto") Then MsgBox (myText)
Next
End Sub

merci

1 réponse

Avatar
Thierry DEMAN [MVP]
Bonjour,

le plus est simple est d'ouvrir un 2ème profil MAPI/outlook se connectant
uniquement à la 2ème BAL.
En programmation, on peut ouvrir plusieurs boîtes/profils sans problème.

A+
--
Thierry DEMAN-BARCELÒ
MVP Exchange, SQL/Server
MCSE2003+M+S,MCSE+I,MCDBA,MCTS,MCITP
http://base.faqexchange.info
http://www.faqexchange.info
"truc" wrote in message
news:
Bonjour

J'ai 2 bals ouvertes dans outlook. Je voudrais faire une recherche dans
les
inbox des 2 bals.
J'arrive bien à le faire pour la bal par defaut, celle lié au profil par
contre la seconde, je n'y arrive pas.

Quelqu'un aurait une solution ?

mon script vba :
Public Sub Mail()
Set app = CreateObject("Outlook.Application")
Set ns = app.GetNamespace("MAPI")
Set folder = ns.GetDefaultFolder(olFolderInbox)
Set msgs = folder.Items
For Each msg In msgs
myText = msg.Body
If InStr(myText, "toto") Then MsgBox (myText)
Next
End Sub

merci