Results 1 to 4 of 4

Thread: [RESOLVED] [Outlook] Deleting a folder

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    79

    Resolved [RESOLVED] [Outlook] Deleting a folder

    I want to permanently delete a folder from the "Deleted Items" folder, but the following code won't work:

    VB Code:
    1. '   Delete temp folder:
    2. Dim myOlApp09 As Outlook.Application, myNameSpace09 As Outlook.NameSpace
    3. Dim myFolder09 As Outlook.MAPIFolder, myFolder08 As Outlook.MAPIFolder
    4.  
    5. Set myOlApp09 = Outlook.Application
    6. Set myNameSpace09 = myOlApp09.GetNamespace("MAPI")
    7. Set myFolder09 = myNameSpace09.GetDefaultFolder(olFolderDeletedItems)
    8.            
    9. Set myFolder08 = myFolder09.Folders("Temp M2C Folder")
    10. myFolder08.Delete '   Delete Folder

    It doesn't show an error message but the folder isn't being deleted.
    I'm programming this in VB6 and its for Outlook 2003.

    Can anyone help me?
    Last edited by __Russell__; Mar 6th, 2008 at 11:07 AM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    79

    Re: [Outlook] Deleting a folder

    Excuse the double post...

    But I still need help with this issue and I won't get it unless this thread is on the first page.

  3. #3
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: [Outlook] Deleting a folder

    Quote Originally Posted by __Russell__
    Excuse the double post...

    But I still need help with this issue and I won't get it unless this thread is on the first page.
    Your code is correct.

    Try deleting a folder which doesn't have any space in it's name. Create a folder "Temp" and then delete it. once it is in the deleted items folder

    try this piece of code...

    vb Code:
    1. Set myFolder08 = myFolder09.Folders("Temp")

    I don't know if this will help but give it a try...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    79

    Re: [Outlook] Deleting a folder

    Seems to simple to work, but it does. Apparently the above code doesn't like spaces in a folder's name.

    Problem solved.

    Thanks for the help.

Posting Permissions

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



Click Here to Expand Forum to Full Width