Getting Email Content in Outlook 2011
Getting Email Content in Outlook 2011
- Subject: Getting Email Content in Outlook 2011
- From: Dave <email@hidden>
- Date: Fri, 24 Apr 2015 10:33:04 +0100
Hi All,
I have the following script that is being run from a Cocoa Application:
on run
tell application id "com.microsoft.Outlook"
activate
set myMessageList to current messages
set myContent to the content of item 1 of myMessageList
end tell
return myContent
end run
If I have an email message with two lines in it:
Hello World!
Goodbye World!
Then I get this returned in “ myContent”:
"<html><head></head><body style=\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;\"><div>Hello World!</div><div><div>Goodbye World!</div></div><div><br></div></body></html>”
However, I’d like it without any of the HTML crap in it and also in a line format so I can do things like:
myFirstTextLine = line 1 of myContent
mySecondTextLine = line 2 of myContent
Is there a way of getting rid of it? I also may want to add a line at the start of the body, Is this possible?
Basically I want to remove a lines when the email opens and add lines when it’s sent. I’ve got most of this working now, but can’t figure out how to add remove the lines when the text is in HTML format.
Thanks a lot
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden