PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Post an Email to a Public Folder
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Post an Email to a Public Folder
![]() |
Post an Email to a Public Folder |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello,
Could someone please provide an example on how to Use VBa code to poast a Email to a Public Group ? Thanks Paul |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 "Paul" <Misc@katanasword.com> wrote in message news:009101c383c8$c465f560$7d02280a@phx.gbl... > Hello, > > Could someone please provide an example on how to Use VBa > code to poast a Email to a Public Group ? > > Thanks > Paul > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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. > > 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 > > > "Paul" <Misc@katanasword.com> wrote in message > news:009101c383c8$c465f560$7d02280a@phx.gbl... > > Hello, > > > > Could someone please provide an example on how to Use VBa > > code to poast a Email to a Public Group ? > > > > Thanks > > Paul > > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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. >> >> 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 >> >> >> "Paul" <Misc@katanasword.com> wrote in message >> news:009101c383c8$c465f560$7d02280a@phx.gbl... >> > Hello, >> > >> > Could someone please provide an example on how to Use VBa >> > code to poast a Email to a Public Group ? >> > >> > Thanks >> > Paul >> > >> >> >. > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
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 "Sue Mosher [MVP]" <suemvp@slipstick.com> wrote in message news:O5M7RrRhDHA.884@TK2MSFTNGP10.phx.gbl... WIll that work, Ken? My experience has been that any MailItem always saves to Drafts, regardless of whether you create it with Items.Add. |
|
|
|
#6 |
|
Guest
Posts: n/a
|
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 "Paul" <Misc@katanasword.com> wrote in message news:06c101c38618$90e91f80$a401280a@phx.gbl... > 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 |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

