Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
bhumika11
New Contributor III

macro for reading outlook mails and printing 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

1 Reply
whiteline
Honored Contributor II

Re: macro for reading outlook mails and printing them in the textbox

What was the purpose to post the same question in different places ?

macro for reading outlook mails and printing them in the textbox