How to create draft email to specified folder 
Author Message
 How to create draft email to specified folder

Sorry for the cross post but this is my first time in these waters so I am
not sure which is the most appropriate forum tor this question.  I usually
hang out at word.word97vba.

I have created a macro in Excel that extracts specified worksheets to new
workbook and creates a new e-mail message with the new workbook as an
attachment.  I would like to have all of the e-mails saved as drafts to a
specified folder in the Inbox.

I have been able to create the e-mails but they get saved to the inbox.  I
have been able to see if my folder exists in the inbox and to create it if
it doesn't.

My question is how do I change the destination folder to my drafts folder so
that the e-mail gets created there instead of the inbox itself?
Alternatively how can I move the e-mail to the correct location after it is
created.

I am using Outlook97.

TonyS.



Mon, 02 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
I'm not sure about Outlook 97 since it's a long time since I used it,
but you can get the MAPIFolder object for your desired folder and then
use the Add method to add your item to that folder. Then when you save
the item it will go to that folder.

--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
Appendices, Sams


Quote:
> Sorry for the cross post but this is my first time in these waters
so I am
> not sure which is the most appropriate forum tor this question.  I
usually
> hang out at word.word97vba.

> I have created a macro in Excel that extracts specified worksheets
to new
> workbook and creates a new e-mail message with the new workbook as
an
> attachment.  I would like to have all of the e-mails saved as drafts
to a
> specified folder in the Inbox.

> I have been able to create the e-mails but they get saved to the
inbox.  I
> have been able to see if my folder exists in the inbox and to create
it if
> it doesn't.

> My question is how do I change the destination folder to my drafts
folder so
> that the e-mail gets created there instead of the inbox itself?
> Alternatively how can I move the e-mail to the correct location
after it is
> created.

> I am using Outlook97.

> TonyS.



Mon, 02 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
Ken,

Thanks for your suggestion.  That is basically what I thought.  I still
can't get it to work properly though.

I have posted the relevant code below hoping someone can help.

***** bigin  code section****
'''These are declared at module level
Public objOutlook As Outlook.Application
Public objOutlookIsCreated As Boolean
Public newf As MAPIFolder
Public objMailItem As MailItem  ' Object
'''''

'the code that does the creating
    If Not objOutlookIsCreated Then
        '''Create the Outlook object
        Set objOutlook = CreateObject("Outlook.Application")
        objOutlookIsCreated = True

        Set olNameSpace = objOutlook.GetNameSpace("MAPI")
        Set myFolder = olNameSpace.GetDefaultFolder(olFolderInbox)

        GotIt = False
        'Iterate the folders to see if it is already there.
        'there should be a more direct way to do this!
         For Each mFolder In myFolder.Folders
            If UCase(mFolder.Name) = UCase(DraftFolderName) Then
                GotIt = True
                Set newf = mFolder
                Exit For
            End If
        Next

        If Not GotIt Then
            'create it
            Set newf = myFolder.Folders.Add(DraftFolderName, _
                       olFolderInbox)
        End If
    End If

    'Add a new mail item

    'This adds it to the inbox.
    'I want it added to the folder newf!!
    Set objMailItem = newf.Items.Add

    '' if I use
    'Set objMailItem = newf.Folders.Add("My Contacts")
    '' it correctly creates the folder where I want.
    ''Why not the mail item?

    With objMailItem
        Application.StatusBar = "Creating mail item..."
        .Body = "Attached is your report for the current month." _
                & vbCr & vbCr _
                & "Regards" & vbCr _
                & "Val "
        .Importance = 1  '0=Low, 1=normal, 2=High
        .Subject = "Performance Reports for: " & thisConsultant
        .ReadReceiptRequested = False
        .Recipients.Add emailTo

        Set colAttachments = objMailItem.Attachments
        colAttachments.Add thisWorkBook

        '  .Display
        .Save   'will save this as an unsent message
        '.Send  'Use .Display to have the email to appear on screen
    End With
***** end code section****

Can anyone see what I am doing wrong?

Thanks
tonyS



Quote:
> I'm not sure about Outlook 97 since it's a long time since I used it,
> but you can get the MAPIFolder object for your desired folder and then
> use the Add method to add your item to that folder. Then when you save
> the item it will go to that folder.

> --
> Ken Slovak
> [MVP - Outlook]
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
> Appendices, Sams



> > Sorry for the cross post but this is my first time in these waters
> so I am
> > not sure which is the most appropriate forum tor this question.  I
> usually
> > hang out at word.word97vba.

> > I have created a macro in Excel that extracts specified worksheets
> to new
> > workbook and creates a new e-mail message with the new workbook as
> an
> > attachment.  I would like to have all of the e-mails saved as drafts
> to a
> > specified folder in the Inbox.

> > I have been able to create the e-mails but they get saved to the
> inbox.  I
> > have been able to see if my folder exists in the inbox and to create
> it if
> > it doesn't.

> > My question is how do I change the destination folder to my drafts
> folder so
> > that the e-mail gets created there instead of the inbox itself?
> > Alternatively how can I move the e-mail to the correct location
> after it is
> > created.

> > I am using Outlook97.

> > TonyS.

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 10 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
Offhand your code looks OK. I'd set the de{*filter*} to break on the line
where you create the mail item and see what Outlook thinks that newf
object is.

--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
Appendices, Sams


Quote:
> Ken,

> Thanks for your suggestion.  That is basically what I thought.  I
still
> can't get it to work properly though.

> I have posted the relevant code below hoping someone can help.

> ***** bigin  code section****
> '''These are declared at module level
> Public objOutlook As Outlook.Application
> Public objOutlookIsCreated As Boolean
> Public newf As MAPIFolder
> Public objMailItem As MailItem  ' Object
> '''''

> 'the code that does the creating
>     If Not objOutlookIsCreated Then
>         '''Create the Outlook object
>         Set objOutlook = CreateObject("Outlook.Application")
>         objOutlookIsCreated = True

>         Set olNameSpace = objOutlook.GetNameSpace("MAPI")
>         Set myFolder = olNameSpace.GetDefaultFolder(olFolderInbox)

>         GotIt = False
>         'Iterate the folders to see if it is already there.
>         'there should be a more direct way to do this!
>          For Each mFolder In myFolder.Folders
>             If UCase(mFolder.Name) = UCase(DraftFolderName) Then
>                 GotIt = True
>                 Set newf = mFolder
>                 Exit For
>             End If
>         Next

>         If Not GotIt Then
>             'create it
>             Set newf = myFolder.Folders.Add(DraftFolderName, _
>                        olFolderInbox)
>         End If
>     End If

>     'Add a new mail item

>     'This adds it to the inbox.
>     'I want it added to the folder newf!!
>     Set objMailItem = newf.Items.Add

>     '' if I use
>     'Set objMailItem = newf.Folders.Add("My Contacts")
>     '' it correctly creates the folder where I want.
>     ''Why not the mail item?

>     With objMailItem
>         Application.StatusBar = "Creating mail item..."
>         .Body = "Attached is your report for the current month." _
>                 & vbCr & vbCr _
>                 & "Regards" & vbCr _
>                 & "Val "
>         .Importance = 1  '0=Low, 1=normal, 2=High
>         .Subject = "Performance Reports for: " & thisConsultant
>         .ReadReceiptRequested = False
>         .Recipients.Add emailTo

>         Set colAttachments = objMailItem.Attachments
>         colAttachments.Add thisWorkBook

>         '  .Display
>         .Save   'will save this as an unsent message
>         '.Send  'Use .Display to have the email to appear on screen
>     End With
> ***** end code section****

> Can anyone see what I am doing wrong?

> Thanks
> tonyS



Tue, 10 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
That is what puzzles me.  the de{*filter*} says that the newf object is the
one I expect the emails to be going to ie the draft folder item.

TonyS.



Quote:
> Offhand your code looks OK. I'd set the de{*filter*} to break on the line
> where you create the mail item and see what Outlook thinks that newf
> object is.

> --
> Ken Slovak
> [MVP - Outlook]
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
> Appendices, Sams



> > Ken,

> > Thanks for your suggestion.  That is basically what I thought.  I
> still
> > can't get it to work properly though.

> > I have posted the relevant code below hoping someone can help.

> > ***** bigin  code section****
> > '''These are declared at module level
> > Public objOutlook As Outlook.Application
> > Public objOutlookIsCreated As Boolean
> > Public newf As MAPIFolder
> > Public objMailItem As MailItem  ' Object
> > '''''

> > 'the code that does the creating
> >     If Not objOutlookIsCreated Then
> >         '''Create the Outlook object
> >         Set objOutlook = CreateObject("Outlook.Application")
> >         objOutlookIsCreated = True

> >         Set olNameSpace = objOutlook.GetNameSpace("MAPI")
> >         Set myFolder = olNameSpace.GetDefaultFolder(olFolderInbox)

> >         GotIt = False
> >         'Iterate the folders to see if it is already there.
> >         'there should be a more direct way to do this!
> >          For Each mFolder In myFolder.Folders
> >             If UCase(mFolder.Name) = UCase(DraftFolderName) Then
> >                 GotIt = True
> >                 Set newf = mFolder
> >                 Exit For
> >             End If
> >         Next

> >         If Not GotIt Then
> >             'create it
> >             Set newf = myFolder.Folders.Add(DraftFolderName, _
> >                        olFolderInbox)
> >         End If
> >     End If

> >     'Add a new mail item

> >     'This adds it to the inbox.
> >     'I want it added to the folder newf!!
> >     Set objMailItem = newf.Items.Add

> >     '' if I use
> >     'Set objMailItem = newf.Folders.Add("My Contacts")
> >     '' it correctly creates the folder where I want.
> >     ''Why not the mail item?

> >     With objMailItem
> >         Application.StatusBar = "Creating mail item..."
> >         .Body = "Attached is your report for the current month." _
> >                 & vbCr & vbCr _
> >                 & "Regards" & vbCr _
> >                 & "Val "
> >         .Importance = 1  '0=Low, 1=normal, 2=High
> >         .Subject = "Performance Reports for: " & thisConsultant
> >         .ReadReceiptRequested = False
> >         .Recipients.Add emailTo

> >         Set colAttachments = objMailItem.Attachments
> >         colAttachments.Add thisWorkBook

> >         '  .Display
> >         .Save   'will save this as an unsent message
> >         '.Send  'Use .Display to have the email to appear on screen
> >     End With
> > ***** end code section****

> > Can anyone see what I am doing wrong?

> > Thanks
> > tonyS

Sent via Deja.com http://www.*-*-*.com/
Before you buy.


Fri, 13 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
I don't have Outlook 97 installed anywhere to test it. In Outlook 2000
it saves the message in the Drafts folder when the .Save statement is
executed. However, the item is created in the Inbox.

BTW, in testing your code I noticed that it is looking for a Drafts
folder as a subfolder of Inbox. Is that what you really want?

The code for me does not save it to the newly created Drafts under
Inbox, it
saves it to the default Drafts folder.

After the item is saved you can use the Move method to move it to
whatever folder you want.

--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
Appendices, Sams


Quote:
> That is what puzzles me.  the de{*filter*} says that the newf object is
the
> one I expect the emails to be going to ie the draft folder item.

> TonyS.



> > Offhand your code looks OK. I'd set the de{*filter*} to break on the
line
> > where you create the mail item and see what Outlook thinks that
newf
> > object is.

> > --
> > Ken Slovak
> > [MVP - Outlook]
> > Lead Author, Professional Outlook 2000 Programming, Wrox Press
> > Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
> > Appendices, Sams



> > > Ken,

> > > Thanks for your suggestion.  That is basically what I thought.
I
> > still
> > > can't get it to work properly though.

> > > I have posted the relevant code below hoping someone can help.

> > > ***** bigin  code section****
> > > '''These are declared at module level
> > > Public objOutlook As Outlook.Application
> > > Public objOutlookIsCreated As Boolean
> > > Public newf As MAPIFolder
> > > Public objMailItem As MailItem  ' Object
> > > '''''

> > > 'the code that does the creating
> > >     If Not objOutlookIsCreated Then
> > >         '''Create the Outlook object
> > >         Set objOutlook = CreateObject("Outlook.Application")
> > >         objOutlookIsCreated = True

> > >         Set olNameSpace = objOutlook.GetNameSpace("MAPI")
> > >         Set myFolder =

olNameSpace.GetDefaultFolder(olFolderInbox)

- Show quoted text -

Quote:

> > >         GotIt = False
> > >         'Iterate the folders to see if it is already there.
> > >         'there should be a more direct way to do this!
> > >          For Each mFolder In myFolder.Folders
> > >             If UCase(mFolder.Name) = UCase(DraftFolderName) Then
> > >                 GotIt = True
> > >                 Set newf = mFolder
> > >                 Exit For
> > >             End If
> > >         Next

> > >         If Not GotIt Then
> > >             'create it
> > >             Set newf = myFolder.Folders.Add(DraftFolderName, _
> > >                        olFolderInbox)
> > >         End If
> > >     End If

> > >     'Add a new mail item

> > >     'This adds it to the inbox.
> > >     'I want it added to the folder newf!!
> > >     Set objMailItem = newf.Items.Add

> > >     '' if I use
> > >     'Set objMailItem = newf.Folders.Add("My Contacts")
> > >     '' it correctly creates the folder where I want.
> > >     ''Why not the mail item?

> > >     With objMailItem
> > >         Application.StatusBar = "Creating mail item..."
> > >         .Body = "Attached is your report for the current month."
_
> > >                 & vbCr & vbCr _
> > >                 & "Regards" & vbCr _
> > >                 & "Val "
> > >         .Importance = 1  '0=Low, 1=normal, 2=High
> > >         .Subject = "Performance Reports for: " & thisConsultant
> > >         .ReadReceiptRequested = False
> > >         .Recipients.Add emailTo

> > >         Set colAttachments = objMailItem.Attachments
> > >         colAttachments.Add thisWorkBook

> > >         '  .Display
> > >         .Save   'will save this as an unsent message
> > >         '.Send  'Use .Display to have the email to appear on
screen
> > >     End With
> > > ***** end code section****

> > > Can anyone see what I am doing wrong?

> > > Thanks
> > > tonyS

> Sent via Deja.com http://www.*-*-*.com/
> Before you buy.



Fri, 13 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
Ken,

Thanks for your help on this.  I am back at that client's site tomorrow
and will have another go then.



Quote:
> I don't have Outlook 97 installed anywhere to test it. In Outlook 2000
> it saves the message in the Drafts folder when the .Save statement is
> executed. However, the item is created in the Inbox.

> BTW, in testing your code I noticed that it is looking for a Drafts
> folder as a subfolder of Inbox. Is that what you really want?

Never really thought about it.  It seemed like a good idea at the
time.  Does that make a difference?

Quote:

> The code for me does not save it to the newly created Drafts under
> Inbox, it
> saves it to the default Drafts folder.

For me it puts it into the Inbox.

Quote:

> After the item is saved you can use the Move method to move it to
> whatever folder you want.

I think I tried that as well. I will have another go.

Cheers
TonyS.

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 15 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
Hi Ken,
I am on site now.

Thanks for your suggestion to move the item. I can now save the item
(it goes to the inbox) and then move it to newf (it goes to my ("Draft
Performance Reports" folder)

The add folder example in help refers to different folder types and the
example uses olFolderInbox.  That is why I put it there.

I don't have a default Drafts folder.  If I create a new message (from
the userinterface) and save it, it goes to my inbox.  Does this mean my
setup is incorrect?

How do I create my drafts folder ("Draft Performance Reports") within
my Mailbox?

Thanks for all your help.  I appreciate it.
TonyS.



Quote:
> I don't have Outlook 97 installed anywhere to test it. In Outlook 2000
> it saves the message in the Drafts folder when the .Save statement is
> executed. However, the item is created in the Inbox.

> BTW, in testing your code I noticed that it is looking for a Drafts
> folder as a subfolder of Inbox. Is that what you really want?

> The code for me does not save it to the newly created Drafts under
> Inbox, it
> saves it to the default Drafts folder.

> After the item is saved you can use the Move method to move it to
> whatever folder you want.

> --
> Ken Slovak
> [MVP - Outlook]
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
> Appendices, Sams



> > That is what puzzles me.  the de{*filter*} says that the newf object is
> the
> > one I expect the emails to be going to ie the draft folder item.

> > TonyS.



> > > Offhand your code looks OK. I'd set the de{*filter*} to break on the
> line
> > > where you create the mail item and see what Outlook thinks that
> newf
> > > object is.

> > > --
> > > Ken Slovak
> > > [MVP - Outlook]
> > > Lead Author, Professional Outlook 2000 Programming, Wrox Press
> > > Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
> > > Appendices, Sams



> > > > Ken,

> > > > Thanks for your suggestion.  That is basically what I thought.
> I
> > > still
> > > > can't get it to work properly though.

> > > > I have posted the relevant code below hoping someone can help.

> > > > ***** bigin  code section****
> > > > '''These are declared at module level
> > > > Public objOutlook As Outlook.Application
> > > > Public objOutlookIsCreated As Boolean
> > > > Public newf As MAPIFolder
> > > > Public objMailItem As MailItem  ' Object
> > > > '''''

> > > > 'the code that does the creating
> > > >     If Not objOutlookIsCreated Then
> > > >         '''Create the Outlook object
> > > >         Set objOutlook = CreateObject("Outlook.Application")
> > > >         objOutlookIsCreated = True

> > > >         Set olNameSpace = objOutlook.GetNameSpace("MAPI")
> > > >         Set myFolder =
> olNameSpace.GetDefaultFolder(olFolderInbox)

> > > >         GotIt = False
> > > >         'Iterate the folders to see if it is already there.
> > > >         'there should be a more direct way to do this!
> > > >          For Each mFolder In myFolder.Folders
> > > >             If UCase(mFolder.Name) = UCase(DraftFolderName) Then
> > > >                 GotIt = True
> > > >                 Set newf = mFolder
> > > >                 Exit For
> > > >             End If
> > > >         Next

> > > >         If Not GotIt Then
> > > >             'create it
> > > >             Set newf = myFolder.Folders.Add(DraftFolderName, _
> > > >                        olFolderInbox)
> > > >         End If
> > > >     End If

> > > >     'Add a new mail item

> > > >     'This adds it to the inbox.
> > > >     'I want it added to the folder newf!!
> > > >     Set objMailItem = newf.Items.Add

> > > >     '' if I use
> > > >     'Set objMailItem = newf.Folders.Add("My Contacts")
> > > >     '' it correctly creates the folder where I want.
> > > >     ''Why not the mail item?

> > > >     With objMailItem
> > > >         Application.StatusBar = "Creating mail item..."
> > > >         .Body = "Attached is your report for the current month."
> _
> > > >                 & vbCr & vbCr _
> > > >                 & "Regards" & vbCr _
> > > >                 & "Val "
> > > >         .Importance = 1  '0=Low, 1=normal, 2=High
> > > >         .Subject = "Performance Reports for: " & thisConsultant
> > > >         .ReadReceiptRequested = False
> > > >         .Recipients.Add emailTo

> > > >         Set colAttachments = objMailItem.Attachments
> > > >         colAttachments.Add thisWorkBook

> > > >         '  .Display
> > > >         .Save   'will save this as an unsent message
> > > >         '.Send  'Use .Display to have the email to appear on
> screen
> > > >     End With
> > > > ***** end code section****

> > > > Can anyone see what I am doing wrong?

> > > > Thanks
> > > > tonyS

> > Sent via Deja.com http://www.*-*-*.com/
> > Before you buy.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.


Mon, 16 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
It doesn't mean your setup is incorrect. To create the drafts folder
as a subfolder of your Inbox just use the code you were using.

Usually a folder setup has a Drafts folder at the same level as Inbox
or Outbox. To create that you can use File|New|Folder and name it
Drafts (for mail type items) and put it anywhere you want.

--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
Appendices, Sams


Quote:
> Hi Ken,
> I am on site now.

> Thanks for your suggestion to move the item. I can now save the item
> (it goes to the inbox) and then move it to newf (it goes to my
("Draft
> Performance Reports" folder)

> The add folder example in help refers to different folder types and
the
> example uses olFolderInbox.  That is why I put it there.

> I don't have a default Drafts folder.  If I create a new message
(from
> the userinterface) and save it, it goes to my inbox.  Does this mean
my
> setup is incorrect?

> How do I create my drafts folder ("Draft Performance Reports")
within
> my Mailbox?

> Thanks for all your help.  I appreciate it.
> TonyS.



Mon, 16 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
Ken,

Thanks for all your help.

I have now released the template to the client.

Still not sure about the default Drafts folder though.  I created a
folder called Drafts within my Mailbox (also tried it with one in my
Inbox).  Created a message from the User interface and saved it.  It
still puts it into the inbox as a draft.  I assume that the "Drafts"
folder must have some other attribute that a normal folder does not
have to make the draft emails go there automatically.

I wasn't sure how to get my Draft reports folder to be created outside
the inbox since the example in the help files uses the inbox type
constant therefore every new folder gets added to its collection.  I
then realised that I could get the inbox folder's parent and create the
new folder there.  That did the trick

Again Thanks.  I like the possibilities of Outlook programming.  I hope
top do a lot more in the future.

Cheers
TonyS.



Quote:
> It doesn't mean your setup is incorrect. To create the drafts folder
> as a subfolder of your Inbox just use the code you were using.

> Usually a folder setup has a Drafts folder at the same level as Inbox
> or Outbox. To create that you can use File|New|Folder and name it
> Drafts (for mail type items) and put it anywhere you want.

> --
> Ken Slovak
> [MVP - Outlook]
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
> Appendices, Sams



> > Hi Ken,
> > I am on site now.

> > Thanks for your suggestion to move the item. I can now save the item
> > (it goes to the inbox) and then move it to newf (it goes to my
> ("Draft
> > Performance Reports" folder)

> > The add folder example in help refers to different folder types and
> the
> > example uses olFolderInbox.  That is why I put it there.

> > I don't have a default Drafts folder.  If I create a new message
> (from
> > the userinterface) and save it, it goes to my inbox.  Does this mean
> my
> > setup is incorrect?

> > How do I create my drafts folder ("Draft Performance Reports")
> within
> > my Mailbox?

> > Thanks for all your help.  I appreciate it.
> > TonyS.

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 17 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
To get items to save in Drafts use Tools|Options|Preferences|E-mail
Options|Advanced E-mail Options, Save unsent items in...

If that doesn't do it then start Outlook with the /resetfolders
switch, that should create a default Drafts folder with the correct
attributes. Use Start|Run and type (without the quotes) "Outlook.exe
/resetfolders"

--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
Appendices, Sams


Quote:
> Ken,

> Thanks for all your help.

> I have now released the template to the client.

> Still not sure about the default Drafts folder though.  I created a
> folder called Drafts within my Mailbox (also tried it with one in my
> Inbox).  Created a message from the User interface and saved it.  It
> still puts it into the inbox as a draft.  I assume that the "Drafts"
> folder must have some other attribute that a normal folder does not
> have to make the draft emails go there automatically.

> I wasn't sure how to get my Draft reports folder to be created
outside
> the inbox since the example in the help files uses the inbox type
> constant therefore every new folder gets added to its collection.  I
> then realised that I could get the inbox folder's parent and create
the
> new folder there.  That did the trick

> Again Thanks.  I like the possibilities of Outlook programming.  I
hope
> top do a lot more in the future.

> Cheers
> TonyS.



Tue, 17 Dec 2002 03:00:00 GMT  
 How to create draft email to specified folder
Hi Ken,

Just a final message to close this thread.

I tried to find the Preferences item you suggested but it did not exist
in outlook 97.  Also tried the /resetfolders option and that didn't
work either.

I looked up MSDN and discovered the reason why.
It' wasn't built to do that.

The reference is below explains that.
XCLN: Outlook 97 Saves Unsent Messages to Inbox Folder
http://support.microsoft.com/support/kb/articles/Q261/2/66.ASP

Cheers and Thanks
TonyS.

Quote:
> If that doesn't do it then start Outlook with the /resetfolders
> switch, that should create a default Drafts folder with the correct
> attributes. Use Start|Run and type (without the quotes) "Outlook.exe
> /resetfolders"

> --
> Ken Slovak
> [MVP - Outlook]
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Co-author of "Programming Microsoft Outlook 2000", Chapters 8-13,
> Appendices, Sams



> > Ken,

> > Thanks for all your help.

> > I have now released the template to the client.

> > Still not sure about the default Drafts folder though.  I created a
> > folder called Drafts within my Mailbox (also tried it with one in my
> > Inbox).  Created a message from the User interface and saved it.  It
> > still puts it into the inbox as a draft.  I assume that the "Drafts"
> > folder must have some other attribute that a normal folder does not
> > have to make the draft emails go there automatically.

> > I wasn't sure how to get my Draft reports folder to be created
> outside
> > the inbox since the example in the help files uses the inbox type
> > constant therefore every new folder gets added to its collection.  I
> > then realised that I could get the inbox folder's parent and create
> the
> > new folder there.  That did the trick

> > Again Thanks.  I like the possibilities of Outlook programming.  I
> hope
> > top do a lot more in the future.

> > Cheers
> > TonyS.

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 23 Dec 2002 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Look at Email in a specified Public Folder

2. Build XML of folders, sub folders and files from specified folder

3. Create new Note in specified folder

4. Create Exchange Public Folders with Specified ACL Permissions with VB

5. Create Exchange Public Folders with Specified ACL Permissions

6. Create Exchange Public Folders with Specified ACL Permissions with VB

7. Specifying eMail-Account when sending an Email

8. Specify an initial folder for the Browse for folder dialog

9. Browse for folder : specify root folder ?

10. Redemption, Outlook XP and Draft Folders

11. Proper selection of Default Drafts folder

12. Redemption SafeMailItem.Send posts to Drafts folder?

 

 
Powered by phpBB® Forum Software