![]() |
Using Postitem
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 |
Using Postitem
Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder
Set objPost = ofldrSrc.Items.Add("IPM.Post") -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "JimRBG" wrote in message ... 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 |
Using Postitem
Sue,
Thank you very much. That was what I was missing. Jim "Sue Mosher [MVP-Outlook]" wrote: Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder Set objPost = ofldrSrc.Items.Add("IPM.Post") -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "JimRBG" wrote in message ... 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 |
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