Create task in Outlook folder

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

0
Utf
2/25/2010 3:25:01 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

3 Replies
759 Views

Similar Articles

[PageSpeed] 12

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" <JayDe@discussions.microsoft.com> wrote in message 
news:DAC021D6-9200-4557-B843-E54531EBB25B@microsoft.com...
> 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
> 
0
Alex
2/25/2010 3:47:12 PM
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" <JayDe@discussions.microsoft.com> wrote in message 
> news:DAC021D6-9200-4557-B843-E54531EBB25B@microsoft.com...
> > 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
> > 
> .
> 
0
Utf
2/25/2010 8:21:01 PM
Hi,
looks ok, you only need to explicitly declare each var:

Dim objOutLook As Object, otherFolder As Object, myFolder As Object, 
myNamespace As Object

are you getting any error?

Alex




"JayDe" <JayDe@discussions.microsoft.com> wrote in message 
news:7F00B53D-B4D0-4444-8F07-DDEB54BAFCB2@microsoft.com...
> 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" <JayDe@discussions.microsoft.com> wrote in message
>> news:DAC021D6-9200-4557-B843-E54531EBB25B@microsoft.com...
>> > 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
>> >
>> .
>> 
0
Alex
2/26/2010 1:25:30 PM
Reply:

Similar Artilces:

Outlook 2000 #176
Customize Outlook Today Button not responding. Any ideas? "JMARA" <anonymous@discussions.microsoft.com> wrote in message news:2bbd01c470a2$9cfee5a0$a501280a@phx.gbl... > Customize Outlook Today Button not responding. Any ideas? www.google.com - you'll find THOUSANDS of hits about this. ...

create a roster
How can you create a weekly roster in which functions can be assigned to more than 10 people. The roster should be updatable, so that when holidays and days off are marked on the weekly roster they will be taken account of it future rosters. ...

Outlook 2003 Calendar *from* office *to* home
Hi, I have MS Outlook 2003 on a Win XP pro OS, synchronized to a corporate calendar via Oracle Connector, and I would like to do this (apparently) simple thing: Syncronize events FROM corporate calendar to my local calendar DO NOT Syncronize events FROM my local calendar to corporate calendar. In Outlook I just see a send/receive option, not just send and just receive separate option. Any hint is welcome Stefano ...

importing or creating reference footnotes
I am trying to import a word document into publisher and it has reference footnotes within the document. The reference footnotes are not coming into the publisher document with the reference footnotes. Correct, they will not up to Publisher 2003. In Publisher 2003 depending on which version of Word you are using if they will or not. -- "If you don't know where you are going, any road will take you there!" ...

Mailbox not created when AD account created
A couple of days ago I noticed that I created a user account but the 'Email Addresses' tab of the user properies did not list any email addresses. Subsequent new user accounts have all experienced the same. I researched the knowledge and tried the recommended solutions to either manaully start the recipient update service or rebuild te recipient update service. Neither recommendation has resulted in a mailbox being created for this particular user or any additional user that I have created since this error first showed up. I performed a Windows update last Thursday and so I bel...

Task Create - Status
I'm trying to make a simple task, when a user owner is assigned a task in CRM, it receives an email letting it know it has one. I have the following below, but it is not generating one when i assign one manually in the CRM. What to do? I've tried both the following: When task is created E-Mail to:[owner];Subject test As well as: When task is created if Task activity status = Open then E-Mail to:[owner];Subject test I've checked the mailserver many times over, and I can send emails manually from the CRM so you can rule that out Tested out ok on our end. Some ideas:...

Converting from Outlook Express to Outlook
Does anyone know of a good web site with information on converting from Outlook Express to Outlook. Have not had much luck with a general web search. Thanks, Will Will Fleenor just export everything from one to the other "Will Fleenor" <will@k2e.com> wrote in message news:et24bTJhEHA.3320@TK2MSFTNGP11.phx.gbl... > Does anyone know of a good web site with information on converting from > Outlook Express to Outlook. Have not had much luck with a general web > search. > > Thanks, Will > Will Fleenor > > Will Fleenor <will@k2e.com> wrote: ...

IMF and Outlook 2003 in POP3 mode
My server gets all email via SMTP and IMF is working great, in OWA and Outlook 2003 Native Exchange mode junk mail goes to the junk folder and users can add exceptions for "junk" they want to receive etc. I'm wondering about my remote users who use Outlook 2003 in POP3 mode to grab their email (since RPC proxy works pretty lousy, can't wait til that is tweaked!). The email in their junk email folder is not downloaded to Outlook, and they have to log into OWA to see it. 1. Should/can Outlook 2003 download these junk messages via POP3? 2. If so, can they be moved to the j...

Help Creating XmlNode / XmlAttribute Elegantly
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString" value="server=(local);" /> </appSettings> </configuration> I am using a XmlDocument for my base implementation. I am looking to see if there is a better way to add a new node / attribute than using XmlDocument.InnerXml. I would consider this to be a hack but couldn't really see another way of doing this without definin...

Create external database
Hi all. I need to create an external database (file). On a site I found this code: ------------------------------------------------------ Function CreateLinkedExternalTable(strTargetDB As String, strProviderString As String, strSourceTbl As String, strLinkTblName As String) As String 'strTargetDB = Source Database Name 'strProviderString = Not used, currently hard coded 'strSourceTbl = Source Table name in the database we are linking too. 'strLinkTblName = Table name we would like to see in the Access Database. Dim catDB As ADOX.Catalog Dim tblLink As...

Message received in Outlook Express but not in Office Outlook why
I used Outlook Express as default for e-mail. I installed Office Outrlook and marked it as default. I continue to receive e-mail on Outlook Express but not on Office Outlook. What settings do I need to make? Open Outlook using the /checkclient switch: http://www.howto-outlook.com/Howto/commandlineswitches.htm -- K. Orland Such as are your habitual thoughts, such also will be the character of your mind; for the soul is dyed by the thoughts - Marcus Aurelius "Old Fud" wrote: > I used Outlook Express as default for e-mail. I installed Office Outrlook > and marked i...

Outlook Recovery
I deleted my email account and wanted to create a new one, but when I open up Outlook, I don't have any Tools option to create a new account. How can I restore the program? You can modify your mail profile via the Mail applet in Control Panel. If you have trouble finding it see; http://www.msoutlook.info/question/123 -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "Daved" ...

Outlook reply and forward problem
In Outlook 2000 using internet email and personal folders. When replying or forwarding an email it removes the original email from the inbox. Is there a setting to leave the original email in the inbox. >-----Original Message----- >In Outlook 2000 using internet email and personal >folders. When replying or forwarding an email it removes >the original email from the inbox. Is there a setting to >leave the original email in the inbox. >. > I was having the same problem. Look a few entries up from your entry in this news group(Subject:Forward_Reply). If you ...

How to create pie chart with %
I have got a problem that I don't if excel could help me to calculate the % within a column and draw a pie chart. My case is I have a column containing a series of numbers. e.g. 1,4,8,1,3,9,11,2,4,5,6,.........etc I want to draw a pie chart that showing 1-3 , 4-6, 7-9, >9 with the corresponding % inside that column. Can anyone tell me how can I make it ? Ray - You need to calculate the frequencies in your data. Let's assume your data is in A1:A12. In B1:B3 enter these numbers, the upper limits on the groupings: 3 6 9 You can enter ">9" into B4 witho...

I check "windows in task bar", after restarting, it is no longer c
In Excel if I check "windows in task bar", (Tools, Opions, View Tab) after I have restarted the machine this option is now unchecked. I have unchecked "Group Similar Task Bar Buttons" in my Task Bar Properties What version of excel are you running? There's a bug in xl2k that shows up if you're working with shared workbooks. If you're not using xl2k and shared workbooks, it sounds like you don't have permission to save this setting in your windows registry. I'd talk to my IT folks to find out if they can fix it. but.... Saved from a previous post....

Outlook Word Editor Curser Default
While typing an email in Outlook 2003 using MS Word editor, the curser goes to another location if you hesitate while composing the email. This drives a person crazy because you can't take your eyes off the screen for a moment. There is an option setting to set the curser off the default setting meaning the curser goes the message box automatically. This fixed it a over year ago, but when I downloaded updates the setting regressed back and I forgot how to correct this problem. HELP!! ...

Email address not created when a new user is created
All, This issue recently happened in my company. Upon creating a new user, the policy was set to create the smtp and X400 address automaticaly. Now when we create a user the smtp and x400 addresses are not created, and when attempting to setup the new user in outlook, the address cant be found. We are using exchange 2003 SP1 on Win2k3 servers. On Wed, 13 Jul 2005 06:49:07 -0700, "Bryan" <Bryan@discussions.microsoft.com> wrote: >All, >This issue recently happened in my company. Upon creating a new user, the >policy was set to create the smtp and X400 addres...

when form created
I have a form which was created by someone else (not a form template) which is like a questionnaire with empty boxes to be completed. When the boxes are typed in all the margins move to accommodate the words being typed. Is there a way to fix/lock the original form and then just fill in the blank boxes? I suspect this is set up as a table with auto resizing enabled. Displaying table gridlines (Table | Show Gridlines) will help you see what you're dealing with. Then select the table, go to the Table tab of Table Properties, click Options, and clear the check box for "A...

Re: How to add public folders in favorite folders
We have an issue where our users (2000+) are screaming for an easy wa och finding the Public Folders folder in Outlook 2003. They are used to the easy way in Outlook 2000 folder list. Is there a way och adding the TOP folder (Public Folders) or maybe th subfolder (All public folders) to the Favorite Folders pane? We know about adding the subsequent folders to Shortcuts and the addin the shortcut to Favotite Folders, but is there a registry hack to mak this possible? We need to deploy this on 2000+ computers. Sincerely Mikael Sk�ld Systems Administrator Exchange Lantm�teriet - National La...

Exchange 2010 MRM, no log files being created
I'm hoping someone can help me with this issue....it has been driving me crazy for days. I have enabled MRM logging on our exchange server, and I can see that some of the policies are working when I run start-managedfolderassistant. We have a retention policy tag on the deleteditems folder, and this does work. The problem is I am not getting any files in the MRM log directory. C:\Program Files\Microsoft\Exchange Server\V14\Logging\Managed Folder Assistant Events 9021 and 9022 are logged in the Application log, but where are the files? Below is the output of my mai...

CRM Service Activity Outlook Calendar Sync Broken
Hi. All was fine until yesterday but now items on the Outlook calendar no longer appear to be tied to the service activities that created them. When I click on a calendar entry it opens an ordinary appointment view of what should be a service activity. Also, the "track in CRM" button seems to do nothing. A newly created service activity will appear on the calendar, but will exhibit the same characteristics described above. Any ideas on how to fix? I've considered reinstalling the CRM client for Outlook or possibly creating a new Outlook profile. Any thoughts would be...

Creating a Brochure
How do you create a 3-column brochure from scratch for Publisher 2002? I can only find the directions for the 2003 version. Quick help would be appreciated, project is due Monday. Create a three-panel or four-panel folded publication http://office.microsoft.com/en-us/assistance/HP011646681033.aspx Scroll down to the section that says "Build a three-panel or four-panel publications from scratch." -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Derek" <Derek@discussions.microsoft.com> wrote in message news...

How to create Access macro shortcut
I'm still using Access 97 and saw something the other day that I would like to use that was in Access 2000. In an Access 2000 database, there was a .mam file in a directory that launched the Access 2000 program and ran a macro. How do you set this up? Can it be done in Access 97? If so, how? Hi. > How do you set this up? Select the macro in the Database Window and right click with your mouse, then select "Create Shortcut..." in the pop-up menu. Follow the prompts for where to place the shortcut and what to name it. The default is: <PathToDeskTopDir>\Shortcut ...

Hot to shift Outlook 2003 to new machine
I've built a new box and want to start replicating my setop from my old machine. As I use Outlook 2003 heavily, how do I transfer everything messages, tasks, rules etc from the old to the new machine??? Your advice would be appreciated Scooter The Help Files have you covered. Only one error in them: do NOT copy you previous PST file to the default directory. Copy them anywhere else you want, but not there because you'll overwrite the PST file Outlook creates for itself: http://office.microsoft.com/en-us/assistance/HA010771141033.aspx More information here: http://www.slips...

New POP3 E-Mail Account Deliver Folder
I have both an Exchange Account and a (personal) POP3 account that I check using Outlook 2003. Currently, both accounts drop new e-mail into my Exchange Inbox - and I have a rule that moves the POP3 e-mail to a personal folder inbox. Problem is, rules don't run when I'm not connected to the Exchange server. Is it possible to have the POP3 account post new e-mails to the personal folder, while keeping the Exchange account posting new e-mails to the exchange inbox? Thanks; Michael Have you tried to set up a personal folder specifically for the pop account and set the exchange acc...