dustywork
asked on
Changing macro to run custom form
Hello,
I've modified the existing task form to add two additional fields. How may I alter the code below so that the code will open this form vs. the default task form. I've modified the Task folder so that if I press the "New Task" button opens my modified task form by default.
I've attached the form (changed extension to .txt, other wise could not upload)
Thanks,
Dusty
Sub DeferIt()
Dim currentOLApp As Outlook.Application
Dim objNameSpace As NameSpace
Dim prpCategories As categories
Dim mthCategory As Category
Dim strActionTitle As String
Dim strErrMsg As String
Dim newTask As Outlook.TaskItem
Dim oMail As Outlook.MailItem
Set currentOLApp = CreateObject("Outlook.Appl ication")
Set currentNameSpace = currentOLApp.GetNamespace( "MAPI")
'frmMain.Show vbModal
'strProjectTitle = InputBox("Enter Project Name")
strActionTitle = InputBox("Enter Next Action")
CreateTask:
' Something needs to be selected
If ExplorerHasSelectedItems() Then
Dim selectedItem As Object
Set selectedItem = Outlook.Application.Active Explorer.S election.i tem(1)
Set newTask = currentOLApp.CreateItem(ol TaskItem)
newTask.subject = strActionTitle
'newTask.subject = GetSubjectFromItem(selecte dItem)
newTask.body = GetItemAsText(selectedItem )
' Add the item as an attachment
' Remove for Outlook 2010.
newTask.Attachments.Add selectedItem
FileIt
' Now we can do the task editing.
newTask.Display
'newTask.categories = mthCategory
newTask.ShowCategoriesDial og
Else
strNoSlct = MsgBox("You must select an item to create an action", vbCritical)
End If
End Sub Modified-task-form.txt
I've modified the existing task form to add two additional fields. How may I alter the code below so that the code will open this form vs. the default task form. I've modified the Task folder so that if I press the "New Task" button opens my modified task form by default.
I've attached the form (changed extension to .txt, other wise could not upload)
Thanks,
Dusty
Sub DeferIt()
Dim currentOLApp As Outlook.Application
Dim objNameSpace As NameSpace
Dim prpCategories As categories
Dim mthCategory As Category
Dim strActionTitle As String
Dim strErrMsg As String
Dim newTask As Outlook.TaskItem
Dim oMail As Outlook.MailItem
Set currentOLApp = CreateObject("Outlook.Appl
Set currentNameSpace = currentOLApp.GetNamespace(
'frmMain.Show vbModal
'strProjectTitle = InputBox("Enter Project Name")
strActionTitle = InputBox("Enter Next Action")
CreateTask:
' Something needs to be selected
If ExplorerHasSelectedItems()
Dim selectedItem As Object
Set selectedItem = Outlook.Application.Active
Set newTask = currentOLApp.CreateItem(ol
newTask.subject = strActionTitle
'newTask.subject = GetSubjectFromItem(selecte
newTask.body = GetItemAsText(selectedItem
' Add the item as an attachment
' Remove for Outlook 2010.
newTask.Attachments.Add selectedItem
FileIt
' Now we can do the task editing.
newTask.Display
'newTask.categories = mthCategory
newTask.ShowCategoriesDial
Else
strNoSlct = MsgBox("You must select an item to create an action", vbCritical)
End If
End Sub Modified-task-form.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome. No problem.
ASKER