Results 1 to 31 of 31

Changing Folder from the default folder

Threaded View

cg7131 Changing Folder from the... 08-23-2011, 12:25 PM
cg7131 Re: Changing Folder from the... 08-24-2011, 01:27 PM
jaslake Re: Changing Folder from the... 08-24-2011, 01:36 PM
jaslake Re: Changing Folder from the... 08-24-2011, 01:42 PM
cg7131 Re: Changing Folder from the... 08-24-2011, 01:56 PM
cg7131 Re: Changing Folder from the... 08-26-2011, 03:52 PM
jaslake Re: Changing Folder from the... 08-26-2011, 11:25 PM
jaslake Re: Changing Folder from the... 08-26-2011, 11:57 PM
cg7131 Re: Changing Folder from the... 08-29-2011, 10:07 AM
jaslake Re: Changing Folder from the... 08-23-2011, 01:13 PM
cg7131 Re: Changing Folder from the... 08-23-2011, 01:53 PM
jaslake Re: Changing Folder from the... 08-23-2011, 05:17 PM
cg7131 Re: Changing Folder from the... 08-23-2011, 05:39 PM
  1. #1
    Registered User
    Join Date
    08-16-2011
    Location
    Edmonton, Canada
    MS-Off Ver
    Excel 2010
    Posts
    20

    Changing Folder from the default folder

    Hi,

    I've been working on a code to take dates from an Excel spreadsheet and to create a task in Outlook using that date. I have the code running, unfortunately, it saves to my personal, default Task list in Outlook. I want to change that so it goes to a task list named SupplyChainTasks...I assume it has something to do with line 13, where it says GetDefaultFolder, but, I don't know how to change that without getting a run-time error. Here's a small portion of the code that I have:

    Sub Create_Task()
    
    Dim olApp As Outlook.Application
        Dim olNs As Namespace
        Dim Fldr As MAPIFolder
        Dim olTsk As TaskItem
        Dim j As Long
        Dim k As Long
        Dim otaskitem As Outlook.TaskItem
    
        Set olApp = New Outlook.Application
        Set olNs = olApp.GetNamespace("MAPI")
        Set Fldr = olNs.GetDefaultFolder(olFolderTasks)
        Set otaskitem = olApp.CreateItem(olTaskItem)
    
    Application.ScreenUpdating = False
    
    k = 0
    
    For Each olTsk In Fldr.Items
        j = 0
            If olTsk.Body = Sheets("Sheet1").Range("A" & Sheets("Link").Range("A2").Value) Then
                j = 1
                If j = 1 Then
                    k = 1
                    End If
    The code goes on, but, I think my problem is in the beginning here. I'm just not sure how to "find" a non-default outlook folder (not sure if I also need to change any .Items references either).

    Thanks!
    Last edited by cg7131; 08-24-2011 at 12:33 PM. Reason: Wrapping code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1