type mismatch error on loop in vba

前端 未结 1 2002
终归单人心
终归单人心 2021-01-23 10:58

I\'m working in Outlook VBA and have constructed a For Next loop to read in the body of MailItems which are formatted like Key=Value pairs. To a point it seems to be working, b

1条回答
  •  闹比i
    闹比i (楼主)
    2021-01-23 11:30

    Dim oitem As Object   'not Outlook.MailItem
    '....
    For Each oitem In ItemsToProcess
        if typename(oitem)="MailItem" then
            'process the mail
            '....
        end if
    Next oitem
    '........
    

    0 讨论(0)
提交回复
热议问题