Re: How to Paste into Outlook 2011 using keystorkes/System Events
Re: How to Paste into Outlook 2011 using keystorkes/System Events
- Subject: Re: How to Paste into Outlook 2011 using keystorkes/System Events
- From: Dave <email@hidden>
- Date: Sat, 27 Feb 2016 15:31:20 +0000
Hi,
Thanks a lot everyone for your help. To Explain the problem:
If you have a Window Containing a Message in Outlook 2011 (and 2016 AFAIK), you can Change the content of the *Message* referenced by the Window, BUT it doesn’t update the Window. So after you have changed the Message Content, if the User saves the Message then the Window Content overwrites the Message Content you just changed.
The only way I’ve found it do it is to change the *Message* content and then Close the Window *without* saving and then re-open it, which causes a horrible “flash” of the Window.
To see this, open up a new email window in outlook and type in some content and save it to drafts. Keep the Main Email Window Drafts section selected so you can see the content of the Message in the Right Hand Panel. Click into the Newly Created and Saved Email Window and then run this script:
tell application id "com.microsoft.Outlook"
set myWindowID to id of front window
set myWindow to (get window id myWindowID)
set myWindowObject to the object of myWindow
set myWindowClass to the class of myWindowObject as string
set myMessageID to id of myWindowObject
set myMessage to (get message id myMessageID)
set the content of myMessage to "O BRAVE NEW CONTENT, THAT HAS SUCH WORDS IN IT"
end tell
You should see the Content of the *Message* in the Main Window change, but the Window is NOT updated, so if so save it again now it will overwrite the changes!
After playing around for a bit, I don’t think that keystroking will work in this case for a number of reasons.
If anyone has any idea how to solve this problem I’d really appreciate your help…..
All the Best
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