E
E. Thornton
I wrote a VB macro that will create a task in Outlook from the currently
selected task in Project. I am using 2003 versions of both applications.
Code is below, in case that is related to the problem.
It works fine when I run it from VB Editor, or when I run the macro from
Tools/Macros, but nothing happens when I use my assigned Ctrl+T shortcut. I
have macro security set to Low. Any idea how to fix this?
CODE:
Sub CreateTask()
' Macro to create Outlook tasks from selected Project tasks.
Const olTaskItem = 3
Dim T As Task
Dim TaskListMessage As String
Set objOutlook = CreateObject("Outlook.Application")
For Each T In ActiveSelection.Tasks
Set objTask = objOutlook.CreateItem(olTaskItem)
objTask.Subject = T.Name
objTask.ReminderSet = True
objTask.DueDate = T.Finish
objTask.Save
If TaskListMessage = "" Then
TaskListMessage = T.Name
Else
TaskListMessage = TaskListMessage & ", " & T.Name
End If
Next T
MsgBox "Tasks created: " & TaskListMessage ' Show confirmation
End Sub
selected task in Project. I am using 2003 versions of both applications.
Code is below, in case that is related to the problem.
It works fine when I run it from VB Editor, or when I run the macro from
Tools/Macros, but nothing happens when I use my assigned Ctrl+T shortcut. I
have macro security set to Low. Any idea how to fix this?
CODE:
Sub CreateTask()
' Macro to create Outlook tasks from selected Project tasks.
Const olTaskItem = 3
Dim T As Task
Dim TaskListMessage As String
Set objOutlook = CreateObject("Outlook.Application")
For Each T In ActiveSelection.Tasks
Set objTask = objOutlook.CreateItem(olTaskItem)
objTask.Subject = T.Name
objTask.ReminderSet = True
objTask.DueDate = T.Finish
objTask.Save
If TaskListMessage = "" Then
TaskListMessage = T.Name
Else
TaskListMessage = TaskListMessage & ", " & T.Name
End If
Next T
MsgBox "Tasks created: " & TaskListMessage ' Show confirmation
End Sub