Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Exchange Server / Applications / January 2006

Tip: Looking for answers? Try searching our database.

Outlook Automation Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alastair MacFarlane - 18 Jan 2006 13:17 GMT
*** Previosly Posted on OfficeDev Automation without a reply ***

Dear All,

I am trying to send an email through Outlook NOT through the default Mailbox
but through another mailbox that I have total rights to. We are using Outlook
2000 and Access 97.

I am using the code below but it does not work:

Private Sub Command0_Click()
   Dim objOutlook As New Outlook.Application
   Dim objMail As MailItem
   Dim oFolders As MAPIFolder
   Dim oInbox As MAPIFolder
   Dim onMAPI As NameSpace
   Set onMAPI = objOutlook.GetNamespace("MAPI")
   Set oFolders = onMAPI.Folders("Mailbox - Balfour Helen")
   Set oInbox = oFolders.Folders("Inbox")

   'Check whether I have the correct Mailbox (and I do!)
   MsgBox oInbox.Items.Count
  '************* error here *************
   Set objMail = oInbox.Items.Add(olMail)
   With objMail
          .To = "MacFarlanea@mydomain.com"  
          .Subject = "Subject of mail message"
          .Body = "Body of mail message"
          .Send
      End With
  End Sub

It errors with the line "Set objMail = oInbox.Items.Add(olMail)".

?err.Number
-382271401
?err.Description
Could not complete the operation. One or more parameter values are not valid.

Can someone please advise me how to send an email from a specified
non-default mailbox.

Thanks again.

Alastair MacFarlane
Clyde Burns - 18 Jan 2006 16:38 GMT
How would I set something up server side to do the following?

Take new emails (ipm.post) in a mail enabled public folder and move them to
subfolders based on keywords in the subject or message body?

Im assuming it has to be an event sink, but I have no experience in how to
write one. Any information you have on how to do this or pointers to where I
can get more information would be greatly appreciated

Clyde Burns
Alastair MacFarlane - 18 Jan 2006 16:51 GMT
Clyde

I think you have posted a question as a response to my original post.

Alastair

> How would I set something up server side to do the following?
>
[quoted text clipped - 6 lines]
>
> Clyde Burns
Clyde Burns - 18 Jan 2006 16:52 GMT
No idea how this was a under someone elses post. Im gonna try again.
Clyde

> How would I set something up server side to do the following?
>
[quoted text clipped - 6 lines]
>
> Clyde Burns
 
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



©2009 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.