Lm th? no ? t? ?ng ho Outlook b?ng cch s? d?ng Visual Basic

D?ch tiu ? D?ch tiu ?
ID c?a bi: 220595 - Xem s?n ph?m m bi ny p d?ng vo.
Bung t?t c? | Thu g?n t?t c?

? Trang ny


Bi vi?t ny ch?ng t? lm th? no ? l?p tr?nh i?u khi?n Microsoft Outlook s? d?ng t? ?ng ha t? Visual Basic. Cc v d? minh ch?ng vi?c t?o ra ?a ch? lin l?c, vi?c t?o ra cc cu?c h?n, v g?i tin nh?n b?ng cch s? d?ng Microsoft Outlook c?a m h?nh ?i t?ng.


Lm theo cc b?c d?i y ? t?o v ch?y cc v d?. ? ch?y m?u, b?n c?n m?t ti li?u tham kh?o s?m b? rng bu?c ? m?t lo?i Microsoft Outlook th vi?n. B?ng sau y li?t k cc tn t?p tin th vi?n ki?u cho cc Phin b?n khc nhau c?a Microsoft Outlook:
Thu g?n b?ng nyBung r?ng b?ng ny
Phin b?n OutlookLm th? no th vi?n ki?u xu?t hi?n trong danh sch tham kh?oTn t?p
Outlook 97"Microsoft Outlook 8,0 ?i t?ng Th vi?n"msoutl8.olb
msoutl8.olbMicrosoft Outlook ?i t?ng 98 Th vi?n"msoutl85.olb
Outlook 2000"Microsoft Outlook 9,0 ?i t?ng Th vi?n"msoutl9.olb
Outlook 2002"Microsoft Outlook 10,0 ?i t?ng Th vi?n"msoutl.olb
Vn ph?ng Outlook 2003"Microsoft Outlook 11,0 ?i t?ng Th vi?n"msoutl.olb

Xy d?ng m?u t? ?ng ha

  1. B?t ?u Visual Basic, v t?o ra m?t tiu chu?n m?i EXE d? n.
  2. T? cc D an tr?nh n, ch?n Tham khao v ch?n Microsoft Outlook.
  3. Thm m?t nt vo m?u c?a b?n.
  4. B?m p nt, v sau thm sau y M? s?:
     ' Start Outlook.
     ' If it is already running, you'll use the same instance...
       Dim olApp As Outlook.Application
       Set olApp = CreateObject("Outlook.Application")
     ' Logon. Doesn't hurt if you are already running and logged on...
       Dim olNs As Outlook.NameSpace
       Set olNs = olApp.GetNamespace("MAPI")
     ' Create and Open a new contact.
       Dim olItem As Outlook.ContactItem
       Set olItem = olApp.CreateItem(olContactItem)
     ' Setup Contact information...
       With olItem
          .FullName = "James Smith"
          .Birthday = "9/15/1975"
          .CompanyName = "Microsoft"
          .HomeTelephoneNumber = "704-555-8888"
          .Email1Address = "someone@microsoft.com"
          .JobTitle = "Developer"
          .HomeAddress = "111 Main St." & vbCr & "Charlotte, NC 28226"
       End With
     ' Save Contact...
     ' Create a new appointment.
       Dim olAppt As Outlook.AppointmentItem
       Set olAppt = olApp.CreateItem(olAppointmentItem)
     ' Set start time for 2-minutes from now...
       olAppt.Start = Now() + (2# / 24# / 60#)
     ' Setup other appointment information...
       With olAppt
          .Duration = 60
          .Subject = "Meeting to discuss plans..."
          .Body = "Meeting with " & olItem.FullName & " to discuss plans."
          .Location = "Home Office"
          .ReminderMinutesBeforeStart = 1
          .ReminderSet = True
       End With
     ' Save Appointment...
     ' Send a message to your new contact.
       Dim olMail As Outlook.MailItem
       Set olMail = olApp.CreateItem(olMailItem)
     ' Fill out & send message...
       olMail.To = olItem.Email1Address
       olMail.Subject = "About our meeting..."
       olMail.Body = _
            "Dear " & olItem.FirstName & ", " & vbCr & vbCr & vbTab & _
            "I'll see you in 2 minutes for our meeting!" & vbCr & vbCr & _
            "Btw: I've added you to my contact list."
     ' Clean up...
       MsgBox "All done...", vbMsgBoxSetForeground
       Set olNs = Nothing
       Set olMail = Nothing
       Set olAppt = Nothing
       Set olItem = Nothing
       Set olApp = Nothing
  5. Ch?y cc d? n, v Click vo nt ? ch?y cc M?.
M?t khi cc m? ch?y, b?n nn c m?t s? lin l?c m?i tn l "James Smith,"m?t cu?c h?n theo l?ch tr?nh ? hai pht v?i m?t l?i nh?c nh? ? xu?t hi?n trong m?t pht, v ? g?i m?t tin nh?n cho tn@Microsoft.com. Ngoi ra, b?i v? b?n thm m?t sinh nh?t cho s? lin l?c c?a b?n (9/15), m?t s? ki?n theo ?nh k? ?c b? sung cho b?n L?ch Outlook ? nh?c nh? b?n c?a ngy.

M?i ? Outlook 2002 l hai h?p tho?i h?p: m?t trong nh?ng c?nh bo b?n r?ng m?t chng tr?nh ang c? g?ng truy c?p vo e-mail ?a ch? b?n ? lu tr? trong Outlook v yu c?u n?u b?n mu?n cho php i?u ny, v m?t tin nh?n cho hi?u qu? m m?t chng tr?nh ang c? g?ng ? g?i th i?n t?. i?u ny tnh nng s? b?o v? b?n kh?i v t?nh ?c s? d?ng b?i m?t virus m s? g?i th i?n t? t? h? th?ng c?a b?n.

? bi?t thm thng tin, h?y b?m vao s? bi vi?t sau ? xem bi vi?t trong C s? Ki?n th?c Microsoft:
290500M t? cc tnh nng an ninh nh pht tri?n lin quan ?n e-mail trong Outlook 2002


? bi?t thm chi ti?t v? ti nguyn l?p tr?nh Outlook, nh?p vo s? bi vi?t sau ? xem cc bi vi?t trong c s? ki?n th?c Microsoft:
166368Ngu?n l?c cho cc h?nh th?c ty ch?nh v l?p tr?nh trong Outlook 97
180826 Ngu?n l?c cho cc h?nh th?c ty ch?nh v l?p tr?nh trong Outlook 98
271225 Ngu?n l?c cho cc h?nh th?c ty ch?nh v l?p tr?nh trong Outlook 2000
287531 Danh sch cc ngu?n l?c cho cc h?nh th?c ty ch?nh v l?p tr?nh v?i Outlook 2002
313802 Lm th? no ? l?y ?a ch? lin l?c b?ng cch s? d?ng m h?nh ?i t?ng Outlook trong Visual Basic.NET
313788 Lm th? no ? t?o m?t cu?c h?n b?ng cch s? d?ng m h?nh ?i t?ng Outlook trong Microsoft Visual Basic.NET

Thu?c tnh

ID c?a bi: 220595 - L?n xem xt sau cng: 21 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
T? kha:
kbautomation kbhowto kboutlookobj kbmt KB220595 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:220595

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