Thank you for the answer, but i am still having problems.
I think there must some problems in the declaration and creation of the
objects. Could you guid me thrue this also. This is what I tried.
Sub LagOutlookOppgave()
Dim OutlookApp As Outlook.Application
Dim OutlookTask As Outlook.TaskItem
Dim objOutLook, otherFolder, myFolder, myNamespace As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
Set myNamespace = objOutLook.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(13) 'olFolderTasks
Set otherFolder = myFolder.Folders("Sjekkliste")
With OutlookTask
.Subject = "Fjerde Oppgave laget av Jørn"
.Body = "Dette er detaljene i oppgaven"
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Date)
.DueDate = DateAdd("n", 5, Date)
.Categories = "MerVerdi"
.ContactNames = "Geir Alexander Olderbakk."
.Save
End With
OutlookTask.Move otherFolder
Set OutlookApp = Nothing
Set OutlookTask = Nothing
End Sub
"Alex Dybenko" wrote:
> Hi,
> something like this.
> Set myNamespace = objOutLook.GetNamespace("MAPI")
> Set myFolder = myNamespace.GetDefaultFolder(13) 'olFolderTasks
> Set otherFolder = myFolder.Folders("OtherTasks")
>
> ..Save 'I think you have to save item before moving it
>
> OutlookTask.Move otherFolder
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://accessblog.net
> http://www.PointLtd.com
>
> "JayDe" <(E-Mail Removed)> wrote in message
> news
AC021D6-9200-4557-B843-(E-Mail Removed)...
> > I am using Access 2007 to create tasks in Outlook 2007. That works fine
> > except for one thing. I cannot find the right keyword for folder or
> > subdirectory.
> >
> > I have organized my tasks in different folder and want to put the tasks I
> > am
> > creating in Access in the right folder.
> >
> > Here is the testcode I am working with so far:
> >
> > Sub MakeOutlookTask()
> >
> > Dim OutlookApp As Outlook.Application
> > Dim OutlookTask As Outlook.TaskItem
> > Set OutlookApp = CreateObject("Outlook.Application")
> > Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
> >
> > With OutlookTask
> > .Subject = "Fjerde Oppgave"
> > .Body = "Dette er detaljene i oppgaven"
> > .ReminderSet = True
> > .ReminderTime = DateAdd("n", 2, Date)
> > .DueDate = DateAdd("n", 5, Date)
> > .Categories = "MerVerdi"
> > .ContactNames = "Geir Alexander Olderbakk."
> >
> > Here I would like to put the folder
> >
> > .Save
> >
> > End With
> >
> > Set OutlookApp = Nothing
> > Set OutlookTask = Nothing
> >
> > End Sub
> >
> .
>