J
JimRBG
I have the following code, but I can't seem to find a way to directly post to
my current folder. The postitem always goes to the Inbox. If I add the move
function I can put it in the correct folder, but then the post is closed and
I have to open it an revise the contents to add my comments.
I'd greatly appreciate some help with this.
Thanks,
Jim
As an example, I have a personal folders (.pst file) containing active
tickets. With each ticket I track all email and activity and make comments
about contacts with customers.
The Post in this Folder (say Ticket1) is what I'm trying to get, but with
the added infomation already displayed in the Subject Field.
Active Tickets
Ticket1
Ticket2
..etc
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
my current folder. The postitem always goes to the Inbox. If I add the move
function I can put it in the correct folder, but then the post is closed and
I have to open it an revise the contents to add my comments.
I'd greatly appreciate some help with this.
Thanks,
Jim
As an example, I have a personal folders (.pst file) containing active
tickets. With each ticket I track all email and activity and make comments
about contacts with customers.
The Post in this Folder (say Ticket1) is what I'm trying to get, but with
the added infomation already displayed in the Subject Field.
Active Tickets
Ticket1
Ticket2
..etc
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