Skripti toimii muuten loistavasti, mutta se kaikkein tärkein kenttä jää tuloksissa tyhjäksi: lähettäjän nimi / sähköpostiosoite. Olen ymmärtänyt, että nimi täytyy kyetä jotenkin erottamaan saapuneesta viestistä, mutta kokeiluni eivät onnistuneet.
Mitä pitäisi olla tässä "my SetSenderName(name, theRow, theSheet)" tilalla, jotta skripti osaisi hakea lähettäjän nimen tai jos nimeä ei ole, niin sähköpostiosoitteen?
Kiitos jo etukäteen! nimimerkillä Mummo 57 v.
Koodi: Valitse kaikki
tell application "Microsoft Excel"
set LinkRemoval to make new workbook
set theSheet to active sheet of LinkRemoval
set formula of range "C1" of theSheet to "SenderName"
set formula of range "B1" of theSheet to "From"
set formula of range "A1" of theSheet to "Date"
end tell
tell application "Microsoft Outlook"
set theRow to 2
set theMessages to selection
repeat with aMessage in theMessages
my SetDate(time received of aMessage, theRow, theSheet)
my SetSenderName(name, theRow, theSheet)
set theRow to theRow + 1
end repeat
end tell
on SetDate(theDate, theRow, theSheet)
tell application "Microsoft Excel"
set theRange to "A" & theRow
set formula of range theRange of theSheet to theDate
end tell
end SetDate
on SetFrom(theSender, theRow, theSheet)
tell application "Microsoft Excel"
set theRange to "B" & theRow
set formula of range theRange of theSheet to theSender
end tell
end SetFrom
on SetSubject(theSubject, theRow, theSheet)
tell application "Microsoft Excel"
set theRange to "C" & theRow
set formula of range theRange of theSheet to theSubject
end tell
end SetSubject
on SetMessage(theMessage, theRow, theSheet)
tell application "Microsoft Excel"
set theRange to "D" & theRow
set formula of range theRange of theSheet to theMessage
end tell
end SetMessage