Usint Postitem

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
 
J

JimRBG

Sorry for the second post, when I submitted the first I got an error message
that it failed. Please ignor this one.
 

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