Outlook focus for typing

selkov

Well-known Member
Joined
Jan 26, 2004
Messages
787
I wrote this simple script to auto populate info that i do several times a day.
When i runt he script I want to be able to add additional information on the subject line.
Right now the typing focus is after the to: email, how can i get it to be at the end of the subject line?

Sub actupd8()
'Add BCC
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Set myOlApp = GetObject(, "Outlook.Application")
Set myItem = myOlApp.ActiveInspector.currentItem
With myItem
.To = "xxx.com" ' [the focus to type is here]
.CC = "xxxx.com"
.Subject = "Account Update" ' [want the focus here]


End With
SendKeys "^{ENTER}"
End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
First, I could not get your macro to create an email for me. I use a different macro that doesn't use
myOlApp, etc.

In any case, finally located these lines of code that work for me in my macro ... see if they work for you as well.

Code:
SendKeys "^{ENTER}"
 SendKeys "{TAB}"
 SendKeys "{TAB}"
 SendKeys "{TAB}"
 SendKeys "{TAB}"
 SendKeys "{TAB}"
 SendKeys "{END}", True
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top