Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro for reading outlook mails and copying them in the textbox

Hi all

First time I am writing a macro and I have to write a macro so that I can read the my outlook mail body and copy it in textbox in the dashboard. I wrote the following macro, however it is giving error and not working

sub SELECT_OT

Set myApp = CreateObject ("Outlook.Application")

Set session = myApp.getnamespace("mapi")
Set myMessage = myApp.CreateItem(olMailItem)
myMessage.BodyFormat = 3
'Outlook.OlBodyFormat.olFormatRichText
session.logon
Set inbox = session.getdefaultfolder(6)
c = 0
For Each m In inbox.items
If m.subject = "GEODIS -mandatory
training" then
  m.display
   go = myMessage.Body
   myMessage.Display
   end if
    Next
ActiveDocument.GetSheetObject("TX111").Write = go
Set myMessage = Nothing

Set myApp = Nothing
Set myInspector = Nothing
Set myDoc = Nothing

ActiveDocument.Fields("Code C@pplis").Clear
ActiveDocument.Fields("Template").Clear
ActiveDocument.Fields("Techno").Clear
End sub

Please help me with the macro
Thanks

Bhumika

2 Replies
MK_QSL
MVP
MVP

CTRL + M

Not applicable
Author

Congratulations