Outlook ReportItem trick to get ReportItem.SenderEmailAddress

Report Items  don't have any direct methods of getting the Reportitem..SenderEmailAddress that I have found- so here is a work around I did figure out...

    Select Case TypeName(objObject)
    Case "ReportItem"  
                            ''This is terrible- but the report item sender is not exposed...  
                            ''Is there a better way somewhere? API call maby?  
      Dim strFrom                 ''String for FROM email address  
      Dim msg As MailItem             ''container for reference mail item message  
      Set objReport = objObject          ''Set the report object to current mail item  
      Set msg = objReport.Actions.Item(1).Execute ''Execute a reply  
      strFrom = msg.Recipients.Item(1).Address   ''Get the resolved address from the 'to' of the reply  
      msg.Delete                  ''delete the unused draft  
End Select

Comments

Popular posts from this blog

Powerpoint countdown and current time in slides VBA

Revit area plans adding new types and references (Gross and rentable)

Revit Python in Visual Studio Revit Stubs 2022 for Python Revit Intellisense