timmer79
asked on
Outlook code question: How to add "highlight subject line of task/select all" to code?
I just received a solution (https://www.experts-exchange.com/questions/25477830/Within-Outlook-I-would-like-to-turn-a-message-into-a-task-with-a-keyboard-shortcut.html?anchorAnswerId=28345637#a28345637) to turn an Outlook message into a task with some code). I use a keyboard shortcut to launch a command based on a macro that generates a task from an email.
***I'd like the subject line to be highlighted/"select all"ed so that I can change the subject line easily without having to select all ever y time.
The code I'm using is attached.
***I'd like the subject line to be highlighted/"select all"ed so that I can change the subject line easily without having to select all ever y time.
The code I'm using is attached.
Public Sub AddToTasks()
Dim olTask As Outlook.TaskItem
Dim olMail As MailItem
Dim olIns As Inspector
Dim olExp As Explorer
Set olTask = Application.CreateItem(olTaskItem)
Set olExp = Application.ActiveExplorer
If olExp.CurrentView <> "Messages" Then Exit Sub
If olExp.Selection.Count <> 1 Then Exit Sub
Set olMail = olExp.Selection.Item(1)
With olTask
.Subject = olMail.Subject
.Body = olMail.Body
.StartDate = Now
.DueDate = DateAdd("d", 7 - Format$(Date, "w", vbSaturday), Date)
.ReminderSet = False
olTask.Status = olTaskInProgress
End With
Set olIns = olTask.GetInspector
olIns.Display ("True")
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I've just repeated my earlier attempts with sendkeys with no success so in the abscence of any other input I stand by my earlier belief that it cannot be done.
Chris
Chris
As per EE, (https://www.experts-exchange.com/help.jsp#hs=29&hi=405) "The correct answer to some questions is "You can't do that."
I suggest that is the maxim that applies in this case.
Chris
I suggest that is the maxim that applies in this case.
Chris
ASKER