PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Post an Email to a Public Folder

Reply

Post an Email to a Public Folder

 
Thread Tools Rate Thread
Old 26-09-2003, 01:54 AM   #1
Paul
Guest
 
Posts: n/a
Default Post an Email to a Public Folder


Hello,

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

Thanks
Paul

  Reply With Quote
Old 26-09-2003, 04:34 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Post an Email to a Public Folder

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
>



  Reply With Quote
Old 27-09-2003, 05:41 PM   #3
Sue Mosher [MVP]
Guest
 
Posts: n/a
Default Re: Post an Email to a Public Folder

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
> >

>
>

  Reply With Quote
Old 29-09-2003, 12:30 AM   #4
Paul
Guest
 
Posts: n/a
Default Re: Post an Email to a Public Folder

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
>> >

>>
>>

>.
>

  Reply With Quote
Old 29-09-2003, 04:10 PM   #5
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Post an Email to a Public Folder

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.


  Reply With Quote
Old 29-09-2003, 04:11 PM   #6
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Post an Email to a Public Folder

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



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off