Results 1 to 7 of 7

Thread: emial shared folder

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    emial shared folder

    could you guys help me
    i am trying to do related the subjct from shared email export into excel matches with sender's name.
    but i am getting error getShareddefaultfoder has run time error 424 object not found
    support, Mailbox has the shared email
    /
    Sub GetFromInbox()
    Dim olApp As Outlook.Application
    Dim olNS As Namespace
    Dim fldr As MAPIFolder
    Dim olMail As Variant
    Dim i As Integer
    Dim MyName
    Dim MyTime
    Set olApp = New Outlook.Application
    Set olNS = olApp.GetNamespace("MAPI")
    Set fldr = olNS.GetSharedDefaultFolder(olFoldersSupport, Mailbox) .Folders("Inbox")

    For Each olMail In fldr.Items
    If olMail.Subject = "confirmation the reports)" Then
    'ActiveSheet.Cells(i, 1).Value = olMail.Subject
    MyName = olMail.To
    MyTime = olMail.ReceivedTime

    Sheets("Sheet1").Activate
    With ActiveSheet.Range("C6:C50")
    Set c = .Find(MyName, LookIn:=xlValues)
    If Not c Is Nothing Then
    Cells(c.Row, 6).Value = MyTime
    End If
    End With

    End If
    i = i + 1
    Next olMail

    Set fldr = Nothing
    Set olNS = Nothing
    Set olApp = Nothing

    End Sub]

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: emial shared folder

    Hi kamakshi...

    In your code,
    Code:
    Set fldr = olNS.GetSharedDefaultFolder(olFoldersSupport, Mailbox) .Folders("Inbox")
    what is Mailbox ? Have you declared it anywhere ? Or, is it supposed to be in double quotes ?
    Code:
    Set fldr = olNS.GetSharedDefaultFolder(olFoldersSupport, "Mailbox") .Folders("Inbox")
    Good luck..

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re:email shared folder

    no it is a shared emailbox

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: emial shared folder

    Hi again...

    I haven't tried those before. And I don't know much about it. But I googled about the GetSharedDefaultFolder() method and found this: http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    That MSDN help is for VBA, but give it a try. The second parameter of that GetSharedDefaultFolder() method is FolderType. So, the Mailbox in your code should be a folder type.

    ....

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

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

    Re: emial shared folder

    Change

    Set fldr = olNS.GetSharedDefaultFolder(olFoldersSupport, Mailbox) .Folders("Inbox")
    to

    Code:
    Set fldr = olNS.GetSharedDefaultFolder(myRecipient, olFolderInbox)
    Where myRecipient represents a user or resource in Outlook, generally a mail message addressee...

    An Example of it's use is as follows

    Code:
    Dim myRecipient As Outlook.Recipient
    
    Set myRecipient = myNamespace.CreateRecipient("koolsid")
    myRecipient.Resolve
    
    If myRecipient.Resolved Then
        Set fldr = olNS.GetSharedDefaultFolder(myRecipient, olFolderInbox)
    End If
    Last edited by Siddharth Rout; Jun 12th, 2010 at 04:08 AM.
    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

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: emial shared folder

    thanks Koolsid.
    but i m trying to get sharedemail
    Default folder is our personal email inobox
    how do i get shared email
    olNS.GetDefaultFolder(olFoldersSupport, Mailbox) .Folders("Inbox")

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: emial shared folder

    Koolsid
    i am trying to get shared mailbox folder.
    i used getshared folder it does not support microsoft. could you help me how to get shared emailbox folder.
    below code i have it
    Code:
    Sub GetFromInbox() 
    Dim olApp As Outlook.Application
    Dim olNS As Namespace
    Dim fldr As MAPIFolder
    Dim olMail As Variant
    Dim i As Integer
    Dim MyName
    Dim MyTime
    Set olApp = New Outlook.Application
    Set olNS = olApp.GetNamespace("MAPI")
    Set fldr = olNS.GetSharedDefaultFolder(olFoldersSupport, Mailbox) .Folders("Inbox") 
    
    For Each olMail In fldr.Items
    If olMail.Subject = "confirmation the reports)" Then
    'ActiveSheet.Cells(i, 1).Value = olMail.Subject
    MyName = olMail.To
    MyTime = olMail.ReceivedTime
    
    Sheets("Sheet1").Activate
    With ActiveSheet.Range("C6:C50")
    Set c = .Find(MyName, LookIn:=xlValues)
    If Not c Is Nothing Then
    Cells(c.Row, 6).Value = MyTime
    End If
    End With
    
    End If
    i = i + 1
    Next olMail
    
    Set fldr = Nothing
    Set olNS = Nothing
    Set olApp = Nothing
    
    End Sub]

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