J
JimRBG
I have the following code that I am trying to use a Postitem and post it
directly to my current folder. For example:
Active Tickets
Ticket1
Ticket2
..etc
When I execute the code the post will always go to the Inbox vs. the current
folder (say Ticket1). I can perform a move, but the post is closed and then
I have to open it and revise it to include my comments.
I'm trying to duplicate the Post in this Folder function, but with the added
information in the Subject Field already displayed.
Any help appreciated.
Jim
Sub myPost()
Dim olApp As Outlook.Application
Dim objPost As Outlook.PostItem
Dim onsMapi As Outlook.NameSpace
Dim ofldrSrc As Outlook.MAPIFolder
Dim strReport As String
' Get the current Folder
Set olApp = Outlook.Application
Set onsMapi = olApp.GetNamespace("MAPI")
Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder
Set objPost = olApp.CreateItem(olPostItem)
strReport = ofldrSrc
With objPost
.Subject = "Service Desk ticket - " & Right(strReport, 8)
'.Post
.Display
End With
'objPost.Move ofldrSrc
End Sub
directly to my current folder. For example:
Active Tickets
Ticket1
Ticket2
..etc
When I execute the code the post will always go to the Inbox vs. the current
folder (say Ticket1). I can perform a move, but the post is closed and then
I have to open it and revise it to include my comments.
I'm trying to duplicate the Post in this Folder function, but with the added
information in the Subject Field already displayed.
Any help appreciated.
Jim
Sub myPost()
Dim olApp As Outlook.Application
Dim objPost As Outlook.PostItem
Dim onsMapi As Outlook.NameSpace
Dim ofldrSrc As Outlook.MAPIFolder
Dim strReport As String
' Get the current Folder
Set olApp = Outlook.Application
Set onsMapi = olApp.GetNamespace("MAPI")
Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder
Set objPost = olApp.CreateItem(olPostItem)
strReport = ofldrSrc
With objPost
.Subject = "Service Desk ticket - " & Right(strReport, 8)
'.Post
.Display
End With
'objPost.Move ofldrSrc
End Sub