Try something like this; just amend to suit your purposes.
Sub SaveEmailAddressInOpenedMessageToFile()
On Error Resume Next
Dim objFS As Scripting.FileSystemObject 'Need to set reference to
"Microsoft Scripting Runtime"
Dim objTS As Scripting.TextStream
Dim objInsp As Outlook.Inspector, objMailItem As Outlook.MailItem
Dim strFilePath As String 'Location and name of output file
Set objFS = New Scripting.FileSystemObject
If ActiveInspector Is Nothing Then Exit Sub
Set objInsp = ActiveInspector
If objInsp.CurrentItem.Class <> olMail Then Exit Sub
Set objMailItem = objInsp.CurrentItem
strFilePath = "C:\Temp\emailaddress.txt"
Set objTS = objFS.CreateTextFile(strFilePath, True)
objTS.Write objMailItem.SenderEmailAddress
objTS.Close
Set objTS = Nothing
Set objFS = Nothing
Set objInsp = Nothing
Set objMailItem = Nothing
End Sub