Article View: be.comp.programming
Article #12017Re: VB & Outlook
From: Eddy Van der Stock
Date: Fri, 28 Dec 2001 18:27
Date: Fri, 28 Dec 2001 18:27
91 lines
3568 bytes
3568 bytes
Probeer dit eens ...
Option Explicit
'Use early binding to create a new Outlook application object
Public olApp As New Outlook.Application
Public nsMAPI As Outlook.NameSpace
Public myAttachment As Attachment
Public adl As Outlook.AddressList
'-----------------------------------------------------
'Create a new mail message
Public Sub NewMailMessage(ImmediateSend As Boolean, theRecipient As String,
_
theSubject As String, theBody As String, _
anAttachment As Boolean, theAttachment As String)
Dim itmMail As Outlook.MailItem
'Return a reference to the MAPI layer
Set nsMAPI = olApp.GetNamespace("MAPI")
'Create a new mail message item
Set itmMail = olApp.CreateItem(olMailItem)
With itmMail
'Add the subject of the mail message
.Subject = theSubject
'Create some body text
.Body = theBody & vbCrLf
'Add a recipient and test to amke sure that the
'address is valid using the Resolve method
With .Recipients.Add(theRecipient)
.Type = olTo
If Not .Resolve Then
MsgBox "Unable to resolve address.", vbInformation
Exit Sub
End If
End With
If anAttachment = True Then
'Attach a file as a link with an icon
' Set myAttachment = itmMail.Attachments.Add(theAttachment,
olByValue, 0, "Prijsofferte")
With .Attachments.Add(theAttachment, olByValue, 0,
"Prijsofferte")
'.DisplayName = "UCW"
End With
End If
If ImmediateSend = False Then
'Display the item
.Display
Else
'Send the mail message
.Send
End If
End With
'Release memory
Set itmMail = Nothing
Set nsMAPI = Nothing
Set olApp = Nothing
'NewMailMessage False, "Aphrosoft@skynet.be", "test", "ikke", True, "c:\
temp\bestand"
End Sub
mvg
Eddy
"f�t��y w�m" <wimbervoets@pandora.be> wrote in message
news:Hs6R7.18715$ZJ2.1121586402@hestia.telenet-ops.be...
> ik zou graag een mailformulier oproepen vanuit het hoofdprogramma. Je zou
> het formulier kunnen vergelijken met hetgeen dat je krijgt als je op een
> html-pagina op een e-maillink drukt. Dan verschijnt er een formulierke met
> 'Aan', 'CC', en ook plaats voor je eigenlijke mail te typen.
> Zoiets zou ik dus willen oproepen.., is dit mogelijk? En indien ja, welke
> componenten moeten er dan eventueel toegevoegd worden aan het form?
>
> cya
>
>
>
>
>
>
Technical Details
Message-ID:
<3c2cb842$0$33503$ba620e4c@news.skynet.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.238.2.15!skynet.be!skynet.be!louie!not-for-mailReferences:
<Hs6R7.18715$ZJ2.1121586402@hestia.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fcea4,9e3245a7c179de4d X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2001-12-28 10:21:57 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!195.238.2.15!skynet.be!skynet.be!louie!not-for-mail From: "Eddy Van der Stock" <sky40490@skynet.be> Newsgroups: be.comp.programming References: <Hs6R7.18715$ZJ2.1121586402@hestia.telenet-ops.be> Subject: Re: VB & Outlook Date: Fri, 28 Dec 2001 19:27:10 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Lines: 93 Message-ID: <3c2cb842$0$33503$ba620e4c@news.skynet.be> Organization: -= Skynet Usenet Service =- NNTP-Posting-Host: 217.136.125.37 X-Trace: 1009563715 reader1.news.skynet.be 33503 217.136.125.37 X-Complaints-To: abuse@skynet.be