S? d?ng t? ?ng ha ? g?i m?t tin nh?n Microsoft Outlook

D?ch tiu ? D?ch tiu ?
ID c?a bi: 161088 - Xem s?n ph?m m bi ny p d?ng vo.
Nng cao: ?i h?i chuyn gia m? ha, kh? nng tng tc, v multiuser k? nng.

Bung t?t c? | Thu g?n t?t c?

TM T?T

Bi vi?t ny cho b?n th?y lm th? no ? s? d?ng t? ?ng ha ? t?o ra v g?i m?t Microsoft Outlook tin nh?n trong Microsoft truy c?p 97.

Bi vi?t ny gi? ?nh r?ng b?n ? quen thu?c v?i Visual Basic cho Cc ?ng d?ng v v?i vi?c t?o ra cc ?ng d?ng Microsoft Access b?ng cch s? d?ng cc cng c? l?p tr?nh ?c cung c?p v?i Microsoft Access. ? bi?t thm thng tin v? Visual Basic cho cc ?ng d?ng, h?y tham kh?o "t?a nh Cc ?ng d?ng v?i Microsoft Access 97 "h?ng d?n s? d?ng.

Cho bi?t thm thng tin v? vi?c s? d?ng t? ?ng ha ? g?i m?t Microsoft Exchange tin nh?n, h?y xem bi vi?t sau trong c s? ki?n th?c Microsoft:
153311S? d?ng t? ?ng ha ? g?i m?t tin nh?n Microsoft Exchange

THNG TIN THM

CHU Y: M? sau y c th? khng ho?t ?ng ng n?u b?n c ci ?t b?n c?p nh?t b?o m?t Outlook E-mail. ? bi?t thm chi ti?t v? b?n c?p nh?t ny, xin vui l?ng xem m?t trong nh?ng bi vi?t sau y trong ki?n th?c Microsoft Base, ty thu?c vo phin b?n no c?a Outlook b?n c:
262631 OL2000: Thng tin v? Outlook E-mail Security Update
262617 OL98: Thng tin v? Outlook E-mail Security Update
Phng php SendObject cung c?p m?t cch ? g?i tin nh?n th MAPI l?p tr?nh trong Microsoft Access. Tuy nhin, phng php SendObject no khng cho b?n truy c?p ? hon thnh ch?c nng th, v d? nh kh? nng nh km t?p tin bn ngoi, ho?c thi?t l?p th t?m quan tr?ng. V d? sau s? d?ng t? ?ng ha ? t?o v g?i tin nh?n th m b?n c th? s? d?ng ? c l?i th? c?a nhi?u tnh nng trong Microsoft Outlook m khng ph?i l c s?n v?i phng php SendObject.

C su b?c chnh khi b?n s? d?ng t? ?ng ha ? g?i m?t Microsoft Outlook th:

  • Kh?i t?o phin lm vi?c Outlook
  • T?o m?t th m?i
  • Thm ng?i nh?n (?n, CC v BCC) v x? l? c?a h? tn
  • ?t thu?c tnh h?p l?, ch?ng h?n nh ch? ?, c th? v t?m quan tr?ng
  • Thm t?p tin nh km (n?u c)
  • Hi?n th?/g?i th
? g?i tin nh?n th Microsoft Outlook l?p tr?nh, lm theo cc b?c sau:

  1. T?o ra m?t m?u vn b?n t?p tin tn Customers.txt trong cc ti li?u C:\My th m?c.
  2. B?t ?u Microsoft Access v m? c s? d? li?u m?u Northwind.mdb.
  3. T?o m?t m-un v g? d?ng sau trong cc khai bo ph?n n?u n khng ph?i l ? c:
    L?a ch?n r? rng
  4. Trn menu cng c?, nh?p vo ti li?u tham kh?o.
  5. Trong ti li?u tham kh?o, nh?p vo Microsoft Outlook 8,0 Object Model v sau b?m OK.

    Lu ?: N?u Microsoft Outlook 8,0 ?i t?ng m h?nh khng xu?t hi?n trong cc Ti li?u tham kh?o c s?n h?p, tr?nh duy?t c?a b?n ? ?a c?ng cho cc t?p tin Msoutl8.olb. N?u b?n khng th? xc ?nh v? tr t?p ny, b?n ph?i ch?y cc Chng tr?nh ci ?t Microsoft Outlook ? ci ?t n tr?c khi b?n ti?n hnh v?i v d? ny.
  6. G? th? t?c sau y trong cc phn h? m?i:
          Sub SendMessage(DisplayMsg As Boolean, Optional AttachmentPath)
              Dim objOutlook As Outlook.Application
              Dim objOutlookMsg As Outlook.MailItem
              Dim objOutlookRecip As Outlook.Recipient
              Dim objOutlookAttach As Outlook.Attachment
    
              ' Create the Outlook session.
              Set objOutlook = CreateObject("Outlook.Application")
    
              ' Create the message.
              Set objOutlookMsg  = objOutlook.CreateItem(olMailItem)
    
              With objOutlookMsg
                  ' Add the To recipient(s) to the message.
                  Set objOutlookRecip = .Recipients.Add("Nancy Davolio")
                  objOutlookRecip.Type = olTo
    
                  ' Add the CC recipient(s) to the message.
                  Set objOutlookRecip = .Recipients.Add("Michael Suyama")
                  objOutlookRecip.Type = olCC
    
                 ' Add the BCC recipient(s) to the message.
                  Set objOutlookRecip = .Recipients.Add("Andrew Fuller")
                  objOutlookRecip.Type = olBCC
    
                 ' Set the Subject, Body, and Importance of the message.
                 .Subject = "This is an Automation test with Microsoft Outlook"
                 .Body = "This is the body of the message." &vbCrLf & vbCrLf
                 .Importance = olImportanceHigh  'High importance
    
                 ' Add attachments to the message.
                 If Not IsMissing(AttachmentPath) Then
                     Set objOutlookAttach = .Attachments.Add(AttachmentPath)
                 End If
    
                 ' Resolve each Recipient's name.
                 For Each ObjOutlookRecip In .Recipients
                     objOutlookRecip.Resolve
                 Next
    
                 ' Should we display the message before sending?
                 If DisplayMsg Then
                     .Display
                 Else
                     .Save
                     .Send
                 End If
              End With
              Set objOutlook = Nothing
          End Sub
    						
  7. ? ki?m tra th? t?c ny, g? d?ng sau trong c?a s? Debug, v sau nh?n ENTER.
    SendMessage ng, "C:\My Documents\Customers.txt"
    Lu ? r?ng m?t tin nh?n m?i ?c hi?n th? trong Microsoft Outlook v?i m?t t?p tin nh km.

    G?i tin nh?n m khng c?n hi?n th? n trong Microsoft Outlook, g?i cc th? t?c v?i m?t gi tr? sai cho ?i s? ?u tin:
    SendMessage sai, "C:\My Documents\Customers.txt"
    ? g?i th m khng c ch? ?nh t?p tin nh km, b? qua th? hai ?i s? khi g?i th? t?c.
    SendMessage True

THAM KH?O

? bi?t thm chi ti?t v? vi?c s? d?ng t? ?ng ha trong Microsoft Access, t?m ki?m ch? m?c tr? gip cho T? ?ng ha, ho?c yu c?u vn ph?ng 97 truy c?p Microsoft Tr? l?.

Cho bi?t thm thng tin v? vi?c s? d?ng t? ?ng ha ? i?u khi?n Microsoft Outlook, Xin vui l?ng xem cc bi vi?t sau trong c s? ki?n th?c Microsoft:
160502ACC: B?ng cch s? d?ng t? ?ng ha ? thm cu?c h?n vo Microsoft Outlook

161012VBA: Lm th? no ? t?o m?t m?c s? lin l?c m?i trong Outlook v?i T? ?ng ha

Thu?c tnh

ID c?a bi: 161088 - L?n xem xt sau cng: 18 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft Access 97 Standard Edition
T? kha:
kbhowto kbinterop kbmt KB161088 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:161088
Khc t Ni dung trong C s Kin thc Khng con c h tr
Bi vi?t ny ni v? cc s?n ph?m m Microsoft khng c?n h? tr? n?a. Do , bi vi?t ny ?c cung c?p "nguyn b?n" v s? khng ?c c?p nh?t.

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com