Applescript and outlook 2011 reply email keeping original body

Hi,
I need help with an applescript.
The idea is...
I receive an email on Outlook 2011, and I can just run this applescript and it will create a response based on the original mail, with a predefined message.
Right now it's working up to the point of creating a reply, adding the message and sending it. However, it is NOT keeping the original content of the message. that I'm replying to.
Can someone help me with that part?
I've tried many stuff and someone else helped me getting this one to work:
tell application "Microsoft Outlook"
    set replyToMessage to selection
    if (replyToMessage is "") then -- nothing selected, don't continue
        log ("NOTHING SELECTED!")
        return
    end if
    set replyMessageSubj to subject of replyToMessage
    set replyMessage to reply to replyToMessage without opening window
    if has html of replyMessage then
        log ("HTML!")
        set the content of replyMessage to "<p>Working on HTML</p><br />"
    else
        log ("PLAIN TEXT!")
        set the plain text content of replyMessage to "Working on plain text"
    end if
    send replyMessage
end tell
Many thanks for the help.

That's exactly what I needed to understand.
The final one is like this in case someone else needs it:
tell application "Microsoft Outlook"
    set replyToMessage to selection
    set mymessage to "Aqui se trapeo con jerga"
    set OldContent to content of replyToMessage
    if (replyToMessage is "") then
        log ("NOTHING SELECTED!")
        return
    end if
    set replyMessageSubj to subject of replyToMessage
    set replyMessage to reply to replyToMessage without opening window
    if has html of replyMessage then
        log ("HTML!")
        set the content of replyMessage to "Hello World<br> This is an HTML test<br><br><br><hr>" & OldContent
    else
        log ("PLAIN TEXT!")
        set the content of replyMessage to "Hello World<br> This is a plain text test <br><br><br><hr>" & OldContent
    end if
    open replyMessage
end tell
Many thanks for the help Llessur999!!

Similar Messages

  • I have recently bought a macbook and am using outlook 2011 as email. i am getting an error message 4.7.0 not allowed when sending emails how do I fix?

    i have a macbook and am using outlook 2011 as email.   receiving okay.   sending okay sometimes.  am now getting error message 4.7.0 not allowed when sending.  what is the cause? how do I fix please?

    I have discovered that the emails have in fact been sent but much later, maybe it's a network problem with the people i am sending it to.  so i checked my sent items and they are there, but at the time the email doesn't go straight into the sent box or drafts so i'm assuming it's disappeared and type it again.  i'll keep going with it, until someone can give me a possible solution or explanation as to what is happening.

  • Sync email between Outlook 2010 (PC) and Outlook 2011 (Mac)

    I have a PC running Windows 7 64 bit and Office 2010 (which includes Outlook 2010).
    I currently use Outlook 2010 on the PC for my email.
    I also have a Mac running Lion 10.7.3 and Office 2011 (which includes Outlook 2011).
    Before iCloud there did not seem to be a way I could share my Outlook email (2010 and 2011 versions) between the PC and iMac.
    I now wonder if I can do this via iCloud and would appreciate any guidance/limitations associated with setting this up etc.
    Thanks in advance.

    You can connect your iCloud email ([email protected]) to Outlook 2010 and Outlook 2011.  Is that what you are after?
    Or are you wanting to do this with another email provider?

  • Osx 10.7.1 and outlook 2011 problem

    osx 10.7.1 and outlook 2011 problem:
    i can't open or reply an email. the dialog window doesnt open. any idea? thx

    The current version of Office is 14.1.2

  • Aperture 3.4.1 and Outlook 2011

    Although you can select Outlook 2011 to email photos directly from Aperture, it does not work in 3.4.1.
    The only email that works is "mail" , which is an email client I do not use.
    I also have Entourage 2008. this is also selectable- but also does not work.
    I have both the current verison of Aperture and the current version of Outlook (office) and the current verison of Entourage 2008.
    I have OSX Lion (most current)
    There is not much on this in the support groups.
    When I try to email a picture from Aperture with Outlook selected- the welcome chime in outlook is audible, but there is no pop up or anything happening.
    When it is selected for Entourage- it will automatically have "mail" come up.
    Can they fix this please?...What is the point of having the update making these email clients selectable if it is not going to work.

    Aperture 3.4.1 is sandboxed, and apparently it can no longer use external clients and plug-ins that are not sandboxed. Outlook and Entourage need to be updated to comply with MAcOS 10.7.5 and 10.8.x to work with Aperture 3.4.1.
    See this lengthy discussion: Re: Aperture email sharing (Outlook) not working since upgrade to mountain lion
    And send feedback Apple - Aperture - Feedback to Apple and Microsoft.
    Regards
    Léonie

  • Outlook 2011 for Mac keeps asking me for password

    I had been using Windows Live Mail (pop 3) for years until last week; rarely, if ever had any problems downloading my mail.
    I just bought a Mac computer and am using Outlook 2011 for Mac; my operating system is Maverick (if that means anything to anyone).
    The BT tech guys suggested I set up my mail accounts as IMAP so that all mail read on the server syncs etc. with my Outlook. It all sounded great. However, ever since I installed Outlook for Mail it asks me for my password numerous times during the day (for each of my 5 email accounts)....it usually does this when the computer has been in sleep mode, i.e., when Outlook tries to download mail from the server. 
    Something else to mention is that whilst the BT tech guys set up my IMAP accounts with:  
    Incoming Port - 993 (requires SSL)
    Outgoing Port - 465 (requires SSL/TLS)
    The BT Mail department (today) told me to revert back to 110 (outgoing)  and 25 (incoming) and to call the incoming and outgoing mail.btinternet.com instead of the smtp.........(I forget the rest of it now) that the tech guys set it up as.
    I've since reverted the incoming and outgoing to mail.btinternet.com but haven't changed the numbers to 110 and 25 because the BT Mail guy said "if you are able to send/receive using the 993 and 465...just leave them. And I *am* able to send/receive. The problem is more the password prompt and the message "server not recognised" or whatever it says....I can't recall the exact words.
    I phoned Apple and they of course say it is an Outlook problem; not an Apple one, though they did help me delete the mail settings in their keychain thingie so that I could put in my passwords again (all passwords are correct by the way).
    Apple did ask, however if my internet service provider are happy for me to have mail set up as IMAP; she epxlained  that it really isn'y *my* choice; it's the server people's choice. 
    My questions are therefore: 1) who/what is my server? Is it BT? My email addresses are all btinternet.com and I'm also using BT Broadband for both home and my business/office.
    I just don't understand why Outlook keeps prompting me for password so my second question is 2) does anyone know why I am being prompted for my password as often as I am? Does this have to do with IMAP settings? with Outlook? or with my Server? or possibly all of the above? and how does one identify the real issue?
    Many thanks! 

    Hi Steve,
    Thanks for this-yes, eventually, I do send/receive fine, once I've poppedd my passwords in. 
    I think you are right in that BT seem to be having unique server/login issues...at least this is what I've read elsewhere too.
    Iroonically, this AM I opened my new Mac and have *not* been asked for passwords so perhaps the changes I made in the settings yesterday (keychain reset in Mac) and also changing it from smtp.....to mail.btinternet.com solved the issue...who knows? All I know is this last week I've nearly lost the will to live on more than one occasion, from the transition from PC Windows Live Mail to Outlook for Mac.

  • Share calendar between Calendar and Outlook 2011

    I have Outlook 2011 for Mac, and need to share my calendar with someone using Yosemite's Calendar.  Is there an easy way to do that?  I know I can share my calendar, but I don't know if the two programs will communicate with each other.

    Hi Dennis_S,
    I found the solution. See below posted by someone else:
    I have found it. It seems that in Lion we had to convert the filename from Mac native to Posix format, in mountain lion this is no longer necessary. If you want to modify the script here are the instructions:
    Finder->Applications. Right click on Aperture and choose "Open package contents"
    Contents->Plugins. Open "Microsoft Outlook.applescript" (with the applescript editor)
    You should see the following 3 lines:
    -- convert the image path from UNIX to Mac
    set this_imagefile_path to (POSIX file this_imagefile) as string
    make new attachment at new_message with properties {file:(this_imagefile_path)}
    these should be replaced with this line:
    make new attachment at new_message with properties {file:(this_imagefile)}
    You are not allow to directly edit this file so save a duplicate somewhere.
    Rename the original script file.
    Copy the modified file to the Contents->Plugins folder of the package. It has to be called "Microsoft Outlook.applescript"
    You will probably be asked for your password a number of times.

  • AppleScript for Outlook 2011

    I'm writing a script for sending same e-mail to several contacts in Outlook 2011 for Mac Contacts database. Basically, I select several Contacts and then run this script that should create and save individual personalized messages to each of the selected contacts.
    Cant' figure out how to extract e-mail address as a text/string value in the line starting with "set to_email_address to __" to use it further in the line starting with "make new to recipient at.."
    Previously I used similar script for Entourage, but after shifting to 2011 I had to re-work it, but still can't make it working!
    Hope for your help!
    set theSubjectLine to "test subj"
    set messageBody to "test message body"
    tell application "Microsoft Outlook"
        set theContacts to selected objects
        repeat with aContact in theContacts
            tell aContact
                set exportList to {first name, last name, email addresses}
            end tell
            set to_f_name to (item 1 of exportList)
            set to_email_address to _________???__________
        try
             set theMsg to make new outgoing message at outbox with properties {subject:theSubjectLine, content:messageBody}
                make new to recipient at theMsg with properties {email address:{name:to_f_name, address:to_email_address}, type:to recipient type}
                move theMsg to mail folder "Drafts" of pop account "XXXXX"
        end try
        end repeat
    end tell

    I wrote a script to perform email-merges using Outlook or Mail/Address Book: https://github.com/craibuc/applescript-email-merge.  Perhaps you will find it useful.

  • Is there a known issue with Mavericks and Outlook 2011 printing?

    Title says it all. I was reading up on past forums both Apple/Microsoft when 10.6.8 messed up Outlook printing, was wondering if anyone else is having a similar issue. I am currently on 10.9.2. I began noticing the issues after updating to 10.9.2.
    To clarify, as a user I can open attached documents from Outlook 2011 and print them that way. But if I use  Command + P, or right click, or any other method I cannot print the actual message of the email. The icon will blink when proper keys are pressed but it will do nothing. Nothing is pending in print queue either.

    Adobe FlashPlayer should first be uninstalled using the appropriate uninstaller available here:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14157&sliceId=2
    and then the latest version obtained from here:
    http://www.adobe.com/shockwave/download/download.cgi?P1ProdVersion=ShockwaveFlash and installed.
    (You can check here: http://www.adobe.com/products/flash/about/ to see which version you should install for your Mac and OS.
    Some users have mentioned that the latest Flash Player (v.9.0.115.0) conflicts with Leopard, and that they have needed to revert to v. 9.0.47. This can be downloaded from here:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14266&sliceId=1

  • Has anyone had recent issues with iCloud mail and Outlook 2011?

    Two days ago without warning when sending an e-mail from Outlook 2011 from a MacBook Pro running 10.8. (Have a .mac account), I had an error pop up, see below.
    Tried entering the password but the same error popped up. Thought there might be an error with the keychain so verified and ran a repair. Still the error continued. I checked that the password was still working and logged into iCloud. I then launched Mac Mail and this worked fine and so also my iPhone / iPad etc. Nothing I did made it possible to send e-maills from my .mac account although I could receive them.
    For the last couple of days I have been using my MacBook AIr for sending mails for the same account via Outlook 2011. This has been working fine all day until 25 mins ago when the same error message popped up on this Mac too. Went through the same set of tests and again Mac Mail works and so does the password.
    Have tried to Google for a solution but can't find anything relevant. Could this be Microsoft trying to cause problems for Apple users, some rogue update, iCloud security certificate issue, or something more sinister. Any suggestions for a fix gratefully received, as currently I can't use Outlook 2011 on either Mac.

    Hi guys!
    I am also having big trouble syncing my iCloud acc. I am able to send email, but i cannot recieve any. I have tried almost everything. I have tried using p01, p02, p99 servers, without solving the problem. I have tryed typing "INBOX" and "/" in IMAP root, still not working. Have anyone got a solution?
    I am using:
    OS X 10.9.1
    Outlook 2011 for mac v. 14.3.8
    I really hope someone has got an answer!
    Sorry the text in the screenshots are in danish. I hope you get the idea anyway.

  • Need help syncing iCal and Outlook 2011 (for Mac) THANKS!

    QUESTION: How do I sync iCal and Outlook up again without duplicating any more events, and very importantly, without sending any more email invitations?
    I just bought an iPhone. I am trying to get my phone and my MacBook Pro synced up through iCloud.
    I realize that I need to have Outlook 2011 and iCal set up for syncing for this to work.
    I did this at one point, and it resulted in all of my ALL DAY appointments being duplicated in Outlook, iCal, and on the calendar on my phone - and iCloud sending out duplicate invitations to events.
    Then, I turned syncing between iCal and Outlook and deleted all of the duplicates in my Outlook.
    Of course, because I haven't set up Outlook to sync with iCal, iCal and my phone's calendar have not changed. There are still duplicates there.
    How do I sync them up again without duplicating any more events, and very importantly, without sending any more email invitations?
    Thanks in advance for any help you can be!
    Cheers!

    My iPhone 4 was working fine, synched with Outlook 2011 on my iMac 11.02 through iTunes. Calendar changes also appeared in iCal, even though I don't use iCal - I only use Outlook. Last week I was prompted to update Outlook, which I did successfully. Today, I plugged the iPhone into the iMac to synch and suddenly all Calendar and Contact items are gone from the iPhone and in iCal on the iMac. In iTunes, the option to synch with Outlook in the Info tab ("other") is greyed out. What happened? Why can't I synch the iPhone anymore with Outlook? All the Calendar and Contact info is still on the iMac in Outlook. Help!

  • I cannot find MACs new 'Photos' in Finder under 'Media' when I try to attach a picture using Outlook 2011 for email.

    Hi I am using Outlook 2011 and i have today uploaded MAC's new 'Photos'. When I try and attach a photo Finder no longer show the IPhoto liv=brary in Finder under Media and there is no replacement.
    Help i need to send a photos using the attach button in an email in Outlook.
    Many thanks.

    as an additional issue i cannot find any method now of attaching a photo to an Outlook 2011 email using Photo (e.g. using the paperclip button or the media browser)
    This seems odd to me and there must be a work around.

  • SSL Renegotiation with Mail.app and Outlook 2011

    My organization recently disabled SSL insecure renegotiation in Windows on our Exchange 2007 servers. We did this because the ssllabs.com report for my site gives it an F rating “because it is vulnerable to MITM attacks because it supports insecure renegotiation”. We changed a registry setting on the server to match this screenshot:
    However, now that we have added those registry entries, both Outlook 2011 and Mail.app no longer works. They simply will not connect to the servers.
    Has anyone else seen this issue? Can anything be done to fix both issues? Any suggestions are welcome, ranging from server settings to programming solutions. I've been searching for this for a while and have only come across one other person who had this issue and he never found a fix for it.
    Thanks in advance,
    Chris

    Have a look at this page which Google turned u:http://www.uwc.edu/itresources/OutlookExpressConfig/OutlookExpressSetup.htm
    Whilst it's obviously for Outlook Express it contains all the details you need to configure the mail client. Point 5 has the server details for IMAP access (you typically can't access a web-based email account in an email client).
    Bear in mind changes you make on the +iPod touch+ will be reflected when you next log-on into your web-based email or desktop email client.
    regards
    mrtotes

  • Outlook 2011 for Mac keeps crashing

    I have been having this same problem for over a month.  It seems it has to do with syncing to my Gmail IMAP account.  Some "corrupted" email comes in and makes Outlook crash.  If I am watching and know what the email is I can restart and delete it and everything works fine.  If not, I must delete all recent emails.  It is only happening with emails that are associated with a rule and organized into a folder.  I have spent hours on the phone with Microsoft with zero results.  Any help would be greatly appreciated!
    Also, (not sure if they are related) when emails come in that are associated with a rule and sent to a folder I always get two copies of the email in the folder.  This does not happen with emails that are simply in the inbox.
    Here is the Error Report:
    Microsoft Error Reporting log version: 2.0
    Error Signature:
    Exception: EXC_BAD_ACCESS
    Date/Time: 2014-01-28 23:23:54 +0000
    Application Name: Microsoft Outlook
    Application Bundle ID: com.microsoft.Outlook
    Application Signature: OPIM
    Application Version: 14.3.9.131030
    Crashed Module Name: CarbonCore
    Crashed Module Version: 1077.14
    Crashed Module Offset: 0x000697b4
    Blame Module Name: mbukernel
    Blame Module Version: 14.3.9.131030
    Blame Module Offset: 0x00008be7
    Application LCID: 1033
    Extra app info: Reg=en Loc=0x0409
    Crashed thread: 10
    **I have also deleted plist files and rebuilt identities with no success.

    Hi, thanks for the explanation but the router is a Home Hub provided by BT which provides the wireless network as well as phone and TV services so it would be a major hassle to change it.
    The internet connection seems to work just fine (i.e. I can connect to Google etc. and browse the net without any problem) so I don't necessarily think it's the router/hub that is the root of the problem - all other devices in the house work perfectly, it is just me that seems to have a problem with Outlook or Mail not connecting to my email account.
    Thanks
    Patrick

  • UAG 2010 SP4 and Outlook 2011 for MAC

    Hi
    We have UAG 2010 SP4 with trunk where autodiscover and EWS services are published without pre-authentication (Authorize all users). Exchange 2013 accepts basic auth on services.
    RCA tests for Outlook Anywhere are passing and we can configure any windows/Outlook2007+ from internet through UAG using autodiscover. 
    However with Outlook2011 for MAC does not go through the mail account creation process when connecting to UAG.
    According to Outlook logs, it will connect to autodiscover service and receive correct service urls for EWS, OAB etc.
    After autodiscover, it tries to connect to EWS which fails and logs following UAG message
    "<DIV style=""" id=""Error_Msg"">You are not authorized to access the application.</div>"
    However with browser and same credentials I can connect to all service urls and they popup authentication prompt and lets user in. Outlook 2011 MAC works when connecting directly to Exchange so this is 99% sure an UAG issue.
    Any suggestion where to look at?

    I guess you already went through this http://technet.microsoft.com/en-us/library/ee921443.aspx
    On Exchange, there is a command related to Outlook for Mac
    Set-CASMailbox -Identity <alias> -EWSAllowEntourage:$True –EWSAllowMacOutlook:$true –EWSAllowList:"*+Mail*"
    According to the blog entry below, if you publish with UAG/TMG it has to be enabled on the Organization level : 
    http://blog.hametbenoit.info/Lists/Posts/Post.aspx?ID=197
    Please don't do it in production, it is just a suggestion :)

Maybe you are looking for

  • Calling static synchronized method in the constructor

    Is it ok to do so ? (calling a static synchronized method from the constructor of the same class) Please advise vis-a-vis pros and cons. regards, s.giri

  • PI 7.1 install in existing landscape

    Hi, We have an existing ECC 6 landscape with EP6 installed. We would like to add PI 7.1 to this . Other than a resource point of view, can we install using the java stack of the EP6 system and the ABAP stack of the ECC system ? Or is it a best practi

  • Label Is not centering in a column chart

    I want to center the value on a column graph,i used LabelStyle for this but this is not working exactly. <asp:Chart ID="bargraphconsldtd" runat="server" EnableViewState="true" Width="600px" style="padding:10px;"> <Series> <asp:Series Name="Overall Po

  • How to find relative address of a file?

    I have a folder structure as below: A +-B   +-D.class   +-D.java Daop.propsThere is a folder named A along with a file Daop.props (not inside folder A) . Inside A there is another folder B which contains D.java and D.class. From this D.java how to ac

  • I keep getting the same junk messages and can't get rid of them permanently. Any suggestions?

    Please help - I keep getting the same junk messages and can't delete them permanently. Same thing happens in the Trash folder. Anyone have suggestions?