+ Reply to Thread
Results 1 to 3 of 3

Excel VBA force new email window to get focus.

  1. #1
    Registered User
    Join Date
    03-25-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Excel VBA force new email window to get focus.

    Hi all,
    I am trying to send an email from a userform in excel. It works on my computer, but on some of my user's computers the new email does not get focus so when I SendKeys to paste the copied data into the email it doesn't get pasted. I am showing the email because the user may need to add attachments before sending.
    1) My main question is: How can I force the newly created email to get system focus so that the paste works?
    2) Side question: Is there a way I can paste the range into the email without using sendkeys?

    Edit: I wanted to note that I added the doevents because I thought that that would allow the system to process things so that the paste would work.

    Please Login or Register  to view this content.
    ____________________________________________________
    Please pretend that there is a witty and deep signature line here.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Excel VBA force new email window to get focus.

    create the message using code using .body, you can copy the range as image, save it locally, use HTMLbody to add an image using <img> or just itterate the data building the message.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    03-25-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Excel VBA force new email window to get focus.

    Nathansav,
    If I save it as an image wouldn't that prevent users from pasting the emailed data into other excel files? I also really need to get system focus on the new email otherwise the users will have to hunt for it to send it which would decrease the probablility of the message getting sent.
    Last edited by CO#; 05-01-2014 at 11:03 AM. Reason: formatting

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to toggle focus between INTERNET explorer window and WINDOWS explorer window using VBA
    By tnuis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2013, 03:29 PM
  2. [SOLVED] Email: Return focus to Excel Userform
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2010, 09:20 AM
  3. Force focus back to Excel?
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2009, 05:30 PM
  4. Email macro to toggle focus between excel and outlook
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2009, 12:30 AM
  5. Activate Excel window if focus lost
    By beeawwb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2008, 08:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1