Using Postitem

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
 
S

Sue Mosher [MVP-Outlook]

Set ofldrSrc = olApp.ActiveExplorer.CurrentFolder
Set objPost = ofldrSrc.Items.Add("IPM.Post")
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top