View Single Post
  #3  
Old September 9th 06, 10:45 PM posted to microsoft.public.outlook.program_vba
bbnimda
external usenet poster
 
Posts: 29
Default Scripting How to create a task in public folder

Hi again, Tks for your response but it doesn't work Err Message " Missing
object "

Sub CommandButton3_click()
Set Rep2Base = Application.GetNamespace("MAPI").Folders("dossiers
publics").Folders("tous les dossiers publics").Folders("Comptes rendus")
msgbox rep2base
Set NewItem = rep2base.Items.Add("Ipm.Post.Cpt Rendu")
newitem.display
end Sub

I think this script is missing a step for creating the task ? no ?

tks


"Sue Mosher [MVP-Outlook]" a écrit dans le message
de news: ...
To create a new item in a non-default folder, use the Add method on the
target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

The message class argument is optional. You can use the code at
http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy
and return the MAPIFolder corresponding to a given path string.

--
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

"bbnimda" wrote in message
...
Hi,

I created a personalised Form in outlook 2003 for my contact, il added a
button and I want by clicking on this button to create à task in the
public
folder

I allready find the script to create this task in my box by using this
Sctipt

Sub CommandButton2_click()
Set myItem = Application.CreateItem(2)
myItem.Subject = "Rapport de traitement"
myItem.Display
end sub

Ps: I now how to extract the name of th public folder



Ads