Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / September 2003

Tip: Looking for answers? Try searching our database.

Post an Email to a Public Folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 26 Sep 2003 01:54 GMT
Hello,

Could someone please provide an example on how to Use VBa
code to poast a Email to a Public Group ?

Thanks
Paul
Ken Slovak - [MVP - Outlook] - 26 Sep 2003 16:34 GMT
To add an email to any email type folder get the folder as a
MAPIFolder, get its Items collection and then use the Add method.

Dim oFolder As Outlook.MAPIFolder
Dim oItems As Outlook.Items
Dim oMail As Outlook.MailItem
Dim oOL As Outlook.Application
Dim oNS As Outlook.NameSpace

Set oOL = CreateObject("Outlook.Application")
Set oNS = oOL.GetNamespace("MAPI")
Set oFolder = oNS.Folders("Public Folders"). _
   Folders("All Public Folders").Folders("MyFolder")
Set oItems = oFolder.Items
Set oMail = oItems.Add(olMailItem)

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm

> Hello,
>
[quoted text clipped - 3 lines]
> Thanks
> Paul
Sue Mosher [MVP] - 27 Sep 2003 17:41 GMT
WIll that work, Ken? My experience has been that any MailItem always saves to Drafts, regardless of whether you create it with Items.Add.

> To add an email to any email type folder get the folder as a
> MAPIFolder, get its Items collection and then use the Add method.
[quoted text clipped - 30 lines]
> > Thanks
> > Paul
Paul - 29 Sep 2003 00:30 GMT
Hello,

I have tried Ken's suggestion, but when I go to save or
send the message it acts as though its a regular email
not to a Public Group. They way our public groups are set
they do not have Email Address's, so any other
suggestions on how to complete this task without having
to Envolve the Email Administrator ?

Thanks
Paul

>-----Original Message-----
>WIll that work, Ken? My experience has been that any MailItem always saves to Drafts, regardless of whether
you create it with Items.Add.

>"Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
news:O6ChkOEhDHA.2212@tk2msftngp13.phx.gbl...
>> To add an email to any email type folder get the folder as a
>> MAPIFolder, get its Items collection and then use the Add method.
[quoted text clipped - 32 lines]
>>
>.
Ken Slovak - [MVP - Outlook] - 29 Sep 2003 16:11 GMT
Sue was correct.

All public folders have email addresses, even if they are hidden from
the GAL, use the folders email address and send the email to the
folder.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm

> Hello,
>
[quoted text clipped - 7 lines]
> Thanks
> Paul
Ken Slovak - [MVP - Outlook] - 29 Sep 2003 16:10 GMT
You're right of course, Sue. It just puts it in Drafts. Sending to the
PF's email address would be the way to go.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm

WIll that work, Ken? My experience has been that any MailItem always
saves to Drafts, regardless of whether you create it with Items.Add.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.