![]() |
Usint Postitem
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 |
Usint Postitem
Sorry for the second post, when I submitted the first I got an error message
that it failed. Please ignor this one. "JimRBG" wrote: 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 |
All times are GMT +1. The time now is 07:05 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com