PC Review


Reply
Thread Tools Rate Thread

how to create a email

 
 
Christoph Strobelt [Bt]
Guest
Posts: n/a
 
      27th Jun 2005
i don't find a way to create an email. can someone help?

in word its easy to create a document, but i can't handle it to create a
email in outlook.

i tried it this way

dim outapp as new outlook.application

set outapp = createobject("outlook.application")

how to go on? there is no command like addemail

outapp.addemail

bye chris


 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      27th Jun 2005
Take a look at the Application.CreateItem method.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Christoph Strobelt [Bt]" <(E-Mail Removed)> wrote in message news:d9ou0u$oid$(E-Mail Removed)...
>i don't find a way to create an email. can someone help?
>
> in word its easy to create a document, but i can't handle it to create a
> email in outlook.
>
> i tried it this way
>
> dim outapp as new outlook.application
>
> set outapp = createobject("outlook.application")
>
> how to go on? there is no command like addemail
>
> outapp.addemail
>
> bye chris
>
>

 
Reply With Quote
 
John Gregory
Guest
Posts: n/a
 
      28th Jun 2005
Chris
I think this example code answers your questions. You can run thi
from Ol or from XL
Joh

Sub Create_OL_Mail(
Dim olApp As Outlook.Applicatio
Dim olMailItm As Outlook.MailIte
Dim olRecipientTo As Outlook.Recipien
Dim olRecipientCC As Outlook.Recipien
Dim olRecipientBCC As Outlook.Recipien

' Create new instance of OL or open current instance
Set olApp = New Outlook.Applicatio
' Create new message
Set olMailItm = olApp.CreateItem(olMailItem
' Add message recipient, then send or display
With olMailIt
Set olRecipientTo = .Recipients.Add("(E-Mail Removed)"
olRecipientTo.Type = olT
Set olRecipientTo = .Recipients.Add("(E-Mail Removed)"
olRecipientTo.Type = olT
Set olRecipientCC = .Recipients.Add("(E-Mail Removed)"
olRecipientCC.Type = olCC 'olTo olCC or olBC
Set olRecipientBCC = .Recipients.Add("(E-Mail Removed)"
olRecipientBCC.Type = olBC
.Subject = "Msg created in VBA
.Body = "Msg created by VBA.
.Display ' Display or Sen
End Wit
Set olMailItm = Nothin
'olApp.Qui
'Set olApp = Nothin
End Su

 
Reply With Quote
 
Christoph Strobelt [Bt]
Guest
Posts: n/a
 
      28th Jun 2005
hi,

thanks for your fast answer to my question. it works great.
thanks a lot,

chris


 
Reply With Quote
 
Christoph Strobelt [Bt]
Guest
Posts: n/a
 
      28th Jun 2005
i still have a question. is there a way to avoid the automatic opening of
this security dialog box,
which asks whether to allow access to my saved email-adress-list?

bye
chris


 
Reply With Quote
 
John Gregory
Guest
Posts: n/a
 
      29th Jun 2005
Chris
It is "almost impossible" to not show the OL "SecurityBox", by desig
to curtail spam and viruses. (1) Programs can be "purchased" to d
that and some early versions of OL would not show it, until update
were installed. But the short answer is no. (2) The work aroun
below, tested in OL2K, does not access the OL name space objec
and/or does not access the email addresses stored in Outlook. But th
scope of what this VB code can do is also limited for the sam
reason

Sub Create_OL_Mail_NoSecurityBox(
Dim olApp As Outlook.Applicatio
Dim olMailItm As Outlook.MailIte
Dim olRecipientTo As Strin
Dim olRecipientCC As Strin
Dim olRecipientBCC As Strin
' Create new instance of OL or open current OL
Set olApp = New Outlook.Applicatio
' Create new OL mail item
Set olMailItm = olApp.CreateItem(olMailItem
' Add message recipients, then send or display
With olMailIt
.To = "(E-Mail Removed);(E-Mail Removed)
.CC = "(E-Mail Removed)
.BCC = "(E-Mail Removed)
.Subject = "Msg created in VBA
.Body = "Msg created by VBA.
.Display ' Display or Sen
End Wit
Set olMailItm = Nothin
'olApp.Qui
'Set olApp = Nothin
End Su

 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish Microsoft Excel Worksheet Functions 8 28th Dec 2009 03:30 PM
Create email from Access on Outlook and make sure that email has beensent using WithEvents method mysqlproject@googlemail.com Microsoft Outlook VBA Programming 3 14th Apr 2009 06:53 PM
Why can't I right click an email address in email to create new business contact? Nigel Freeney Microsoft Outlook BCM 0 4th Jun 2008 03:31 PM
2 simple macros - create task from email and move email to folder sselden13@gmail.com Microsoft Outlook VBA Programming 5 4th Feb 2007 09:57 AM
Create macro to write email address in email window =?Utf-8?B?YWxieWNpbmR5?= Microsoft Word Document Management 3 22nd Aug 2005 07:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:13 PM.