Re: Saving email into a nested folder -- simple question?
- From: "Joseph Boland" <JosephBoland@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Jul 2005 17:19:03 -0700
Thanks. This behavior really puzzled me. I suppose the Add method might as
well reference the default folder then!
I'll pick up your book and/or Thomas Rizzo's. I just began work on an
Outlook automation project and was surprised to find much less information
online from Microsoft than I'm used to.
--
Software Engineer
Educational & Community Supports
University of Oregon
Eugene, OR 97403-1235
"Sue Mosher [MVP-Outlook]" wrote:
> New messages always save in Drafts, regardless of what folder you use for the Items.Add method. You need to add a statement to move the saved message to the desired folder.
>
> movedMail = mobjMailMsg.Move(mobjMailFolder)
>
> Note that you don't need to close it because you never opened it.
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "Joseph Boland" <JosephBoland@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:8DB4FD96-ABCD-4957-897F-266937124FBC@xxxxxxxxxxxxxxxx
> > The VB.NET code below is supposed to create and save an email message in a
> > folder within the default drafts folder. It successfully creates the
> > subordinate folder but saves the email message in the root drafts folder
> > ("Drafts"). Why?
> >
> > 'Create a mail folder for application use within the root email drafts folder.
> > mobjEmailDrafts =
> > mobjNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDrafts)
> > mobjMailFolder = mobjEmailDrafts.Folders.Add(AppMailFolder)
> > '...
> > mobjMailMsg = mobjMailFolder.Items.Add()
> > mobjRecipient = mobjMailMsg.Recipients.Add(RecipientEmailAddress)
> > mobjRecipient.Type = Outlook.OlMailRecipientType.olTo
> > mobjMailMsg.Subject = Subject
> > mobjMailMsg.Body = BodyText
> > mobjMailMsg.BodyFormat = Outlook.OlBodyFormat.olFormatPlain
> > mobjMailMsg.Save()
> > mobjMailMsg.Close(Outlook.OlInspectorClose.olSave)
>
>
.
- Follow-Ups:
- Re: Saving email into a nested folder -- simple question?
- From: Sue Mosher [MVP-Outlook]
- Re: Saving email into a nested folder -- simple question?
- References:
- Saving email into a nested folder -- simple question?
- From: Joseph Boland
- Re: Saving email into a nested folder -- simple question?
- From: Sue Mosher [MVP-Outlook]
- Saving email into a nested folder -- simple question?
- Prev by Date: Algorithm used by Resolve method
- Next by Date: Re: Algorithm used by Resolve method
- Previous by thread: Re: Saving email into a nested folder -- simple question?
- Next by thread: Re: Saving email into a nested folder -- simple question?
- Index(es):
Relevant Pages
|