Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue Regarding Email content checking
#1
Not Solved
Hi Friends,
i need to check the email notification(content) which was generated by application automatically.

i have used below mentioned code to check the email

Code:
'path of the  updating contnet in the Excel  file
strDataFileParam="D:\QTP_Razoo\"

'subject ine and sheet name
strParam="hprazoo15@sra.com] - 5 tips for making PRO2 FOR HP15 a huge success,PROPageCreation"

                                                                                    set olapp = createobject("outlook.application")
                                                                                    set inbox = olapp.getnamespace("mapi").folders
                                                    
                                                                                    Set MyExcel = createobject("Excel.application")
                                                                                    
                                                                                     Set MyFile=myExcel.workbooks.open (Mid(strDataFileParam,1,12) &"\RazooExcel.xls")
                                                                                    
                                                                                    
                                                                                    arrstrParam=Split(strParam,",")

                                                                                    for each fold in inbox
                                                                                        getsubfolders1(fold)
                                                                                    next
                                                                                     MyExcel.ActiveWorkbook.Save
                                                                                    
                                                                                    myExcel.Quit
                                                                                    Set myExcel=Nothing    
                                                                                                                            






    Sub getunreadmails1(objfolder)
                    
                                                    Set col = objfolder.items
                                                    For each mail in col
                                                    If mail.unread then
                                                        strMailSub1=mail.subject
                                                        
                                                    
                                                        If Instr(strMailSub1,arrstrParam(0))>0 Then
                
                                                        strMailBody1=mail.body
                                                        
                
                                                MyFile.worksheets(arrstrParam(1)).Cells(2, 2)= strMailBody1
                
                                                    If  MyFile.worksheets(arrstrParam(1)).Cells(2,1)= myFile.worksheets(arrstrParam(1)).Cells(2, 2) Then
                                                        MyFile.worksheets(arrstrParam(1)).Cells(2,3).value="Pass"
                                                        else
                                                        'Msgbox "Fail"
                                                         MyFile.worksheets(arrstrParam(1)).Cells(2,3).value="Fail"
                                                    End If
                
                                                    mail.unread=false
                                                    End if
                                                    end if
                                                    next
    End Sub

    
    Sub getsubfolders1(objparentfolder)
                                                [b]set colfolders = objparentfolder.folders[/b]                                                
                                                For each objfolder in colfolders
                                                
                                                    set objsubfolder = objparentfolder.folders(objfolder.name)
                                                      
                                                    if objfolder.name<>"notes" then
                                                        getunreadmails1 (objfolder)
                                                    end if
                                                    getsubfolders1(objsubfolder )
                
                                                next
    End Sub


Above code was working earlier perfectly that time we were using Xp, Outlook2000; but now I am using Windows7 and Outlook2003.
Now I am getting error as"The messaging interface has returned an unknown error. If the problem persists restart out look".

Even though after restarted outlook also same problem i am getting. I bolded the code where I got error.

Can u please share the solution if any one of know the solution.

My client is using Windows7, Outlook2007 here also its working fine.


Attached Files Image(s)
   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Read Content inside PDF kotaramamohana 0 1,089 09-02-2020, 05:49 PM
Last Post: kotaramamohana
  Extracting Email Body from Outlook waseem.khan.91 0 1,889 03-04-2019, 02:53 PM
Last Post: waseem.khan.91
  Extracting Email Body from Outlook waseem.khan.91 0 1,031 03-01-2019, 02:51 PM
Last Post: waseem.khan.91
  Find the email using subject with the help of vb script Raheem Shaik 0 1,459 12-12-2018, 02:57 PM
Last Post: Raheem Shaik
  how to write the content obtained using the method GetPdfText Anisha 0 1,337 10-24-2017, 08:49 PM
Last Post: Anisha

Forum Jump:


Users browsing this thread: 1 Guest(s)