BenjaminDana
03-20-2017, 07:25 AM
Howdy everyone,
My company recently upgraded to Microsoft 365 (2016 edition). After the change my coworkers and I decided to create a new public group.
This is working out swell, but I have a program that used to run through a person's inbox and open up emails based on the subject line. Trying to adapt this to work with the public group folder has led me to a stopping point.
Sub OpenGroupEmails()
Dim NS As Outlook.NameSpace
Dim objOwner As Outlook.Recipient
Dim fldr As Outlook.MAPIFolder
Set NS = Application.GetNamespace("MAPI")
Set objOwner = NS.CreateRecipient("MI Team")
objOwner.Resolve
If objOwner.Resolved Then
MsgBox objOwner.Name
Set fldr = NS.GetSharedDefaultFolder(objOwner, olPublicFoldersAllPublicFolders)
End If
End Sub
The group name is "MI Team", when I run this I get a message box with the words "MI Team". But the next line gives me the following error "Run-time error '-2147024809 (80070057)': Sorry, something went wrong. You may want to try again."
I feel like I'm missing something simple that will resolve this issue.
Thanks for taking the time to look over my problem. God bless. :)
My company recently upgraded to Microsoft 365 (2016 edition). After the change my coworkers and I decided to create a new public group.
This is working out swell, but I have a program that used to run through a person's inbox and open up emails based on the subject line. Trying to adapt this to work with the public group folder has led me to a stopping point.
Sub OpenGroupEmails()
Dim NS As Outlook.NameSpace
Dim objOwner As Outlook.Recipient
Dim fldr As Outlook.MAPIFolder
Set NS = Application.GetNamespace("MAPI")
Set objOwner = NS.CreateRecipient("MI Team")
objOwner.Resolve
If objOwner.Resolved Then
MsgBox objOwner.Name
Set fldr = NS.GetSharedDefaultFolder(objOwner, olPublicFoldersAllPublicFolders)
End If
End Sub
The group name is "MI Team", when I run this I get a message box with the words "MI Team". But the next line gives me the following error "Run-time error '-2147024809 (80070057)': Sorry, something went wrong. You may want to try again."
I feel like I'm missing something simple that will resolve this issue.
Thanks for taking the time to look over my problem. God bless. :)