Export Outlook message to Excel, outlook macro
I'm looking to create a simple outlook macro that would dump emails in a specific folder into an excel worksheet. The folder can be called "test" for reference purposes and the excel spreadsheet can be anything.
Outlook will always remain open and the spreadsheet would not be located on a server. This is all local.
Information I would like coming over is the date and the body (possibly the subject).
I've tried this a few different times and have yet to get a working version. I'm using Office 2007.
Any help would be greatly appreciated (appreciated = paypal???):help You all are great and very kind for helping out. It is greatly appreciated.
Can I find out the Received By Email Address?
This was very helpful, together with the list of available properties at msdn.microsoft.com/en-us/library/ff861252.aspx.
However, is there a way to get the email address an email was sent to?
The property list gives ReceivedByName and ReceivedOnBehalfOfName, which both give the display name, not the email address.
The other options are ReceivedByEntryID and ReceivedOnBehalfOfEntryID, but can you get from there to the email address? Or is there another way of doing this?
Outlook Express Script Help Needed
Can anyone help? I need this script to work on outlook express it works on entorage :doh: :banghead: :think:
*********************************************
property msgID : 0
property RefNr : 0
property senderName : "John Doe"
property senderAddress : "john@doe.com"
tell application "Microsoft Outlook"
if msgID ≠ 0 then
try
set msgTemplate to message id msgID
on error
beep
display dialog "! You must have either done a complex rebuild of Entourage recently or deleted your message template." & return & return & "Select your template and run the Message template script again to reset it." buttons {"OK"} default button "OK" with icon 2
set msgID to 0
return
end try
else
try
set sel to current messages
set msgTemplate to item 1 of sel
if (count of sel) ≠ 1 or class of msgTemplate ≠ outgoing message or «class dlvs» of msgTemplate ≠ «constant Edlvunst» then error number -128
set folderID to id of «class stor» of msgTemplate
set isLocal to my GetUrFolder(folderID)
if not isLocal then return
on error
beep
display dialog "! You must select just one unsent, saved draft message as your message template in a LOCAL folder [\"On My Computer\"]." & return & return & "Do so, and run the script again." buttons {"OK"} default button "OK" with icon 2 --
return
end try
display dialog "Do you want to save your template as UNSENT, allowing you to alter it but always showing as bolded in its folder, or as a SENT message, unbolded but unalterable?" buttons {" Cancel ", " Sent ", " Unsent "} default button 3 with icon 1
if button returned of result = " Cancel " then
return
else if button returned of result = " Sent " then
set «class dlvs» of msgTemplate to «constant Edlvsent»
end if
set msgID to id of msgTemplate
display dialog "All set up!" & return & return & "Do you want to write a new email message with your template right now?" buttons {"Not Now", "Open New Message"} default button 2 with icon 1
if button returned of result = "Not Now" then return
end if
set folderID to id of «class stor» of msgTemplate
set isLocal to my GetUrFolder(folderID)
if not isLocal then return
--if doesn't quit then all is OK
set RefNr to RefNr + 1
set newMsg to duplicate msgTemplate --message id msgID
tell newMsg
set subject to "WLN: " & (text -4 thru -1 of ("0000" & RefNr)) & " - "
set sender to {«class addr»:senderAddress, display name:senderName}
end tell
move newMsg to «class pDrF»
open newMsg
end tell
on GetUrFolder(someID)
local theParent, parentID, isTrue
tell application "Microsoft Outlook"
try
set theParent to parent of folder id someID
if class of theParent = folder then
set parentID to id of theParent
set isTrue to my GetUrFolder(parentID)
if not isTrue then return false
else if {class of theParent} is in {«class impA», «class HtmA»} then
beep
display dialog "! You must leave your message template in a LOCAL folder [\"On My Computer\"] for this script to work." & return & return & "Move or copy it to a local folder (Drafts folder or another), select it there, and run the script once to set it up again." buttons {" Cancel "} default button 1 with icon 0
set my msgID to 0
return false
end if -- parent must be Entourage, folder is top-level
on error -- parent must be Entourage, folder is top-level
return true
end try
end tell
return true
end GetUrFolder