defrees
asked on
posting to a public folder
How do I take a post item that I've created and post it to a specific public folder?
ASKER
Maybe I should be more specific. I am writing a VB app that I would like to post items to a public folder. I can create the item fine, but there doesn't seem to be any property to specify which public folder the item should be sent to. And it defaults to the inbox.
ASKER
Maybe I should be more specific. I am writing a VB app that I would like to post items to a public folder. I can create the item fine, but there doesn't seem to be any property to specify which public folder the item should be sent to. And it defaults to the inbox.
Sorry, misunderstood.
I can't help you, but maybe someone else can.
I can't help you, but maybe someone else can.
Have you checked out:
Programming Examples for Referencing Items and Folders
http://support.microsoft.com/support/kb/articles/Q180/6/96.asp
Programming Examples for Referencing Items and Folders
http://support.microsoft.com/support/kb/articles/Q180/6/96.asp
I've created a form and the address of the mail is to a public folder. It very simple.
Get the email address for the public folder and put it on the To field, then when you post, it will go to that Public Folder.
Get the email address for the public folder and put it on the To field, then when you post, it will go to that Public Folder.
The following fragment of VB code I'm using to create and move items to our KnowledgeBase which is situated in Public Folders/All Public Folders/KB folder
-------------------------- ---------- ---------- -
'declarations
Dim oApp As Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oFolder As MAPIFolder
Dim oItem As Outlook.PostItem
Set oApp = CreateObject("Outlook.Appl ication")
Set oNS = oApp.GetNamespace("MAPI")
Set oItem = oApp.CreateItem(olPostItem )
'Do something with item ....
'you should save before move
oItem.Save
'select destination folder here
Set oFolder = oNS.Folders("Public Folders").Folders("All Public Folders").Folders("KB")
'move item
oItem.Move oFolder
-------------------------- ------
Good luck,
Bodya
--------------------------
'declarations
Dim oApp As Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oFolder As MAPIFolder
Dim oItem As Outlook.PostItem
Set oApp = CreateObject("Outlook.Appl
Set oNS = oApp.GetNamespace("MAPI")
Set oItem = oApp.CreateItem(olPostItem
'Do something with item ....
'you should save before move
oItem.Save
'select destination folder here
Set oFolder = oNS.Folders("Public Folders").Folders("All Public Folders").Folders("KB")
'move item
oItem.Move oFolder
--------------------------
Good luck,
Bodya
ASKER
Thank you for the answer Bodya! I had already thought about that method as well as the one chewhoung offered. However, there is a better way. You can use the add method as follows:
Set NewPostItem = OLFolder.Items.Add(olPostI tem)
Then you manipulate it like a normal post item. I found this solution from the Microsoft Knowledge base that david_levine pointed me to. Thanks David!
Set NewPostItem = OLFolder.Items.Add(olPostI
Then you manipulate it like a normal post item. I found this solution from the Microsoft Knowledge base that david_levine pointed me to. Thanks David!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If it is a word or excel, etc. item then choose from the file menu "sent to" then select folder.