Office中国论坛/Access中国论坛
标题:
在OUTLOOK里能编程吗
[打印本页]
作者:
ui
时间:
2004-5-28 21:04
标题:
在OUTLOOK里能编程吗
只用过Access编写VBA,在OUTLOOK里能编程吗
作者:
zhengjialon
时间:
2004-6-4 00:26
当然可以用VBA编程,它是和ACCESS、EXCEL等一样都是OFFICE中的组件,同样可以用VBA来编程控制并协同工作发挥强大的功能,这是MS OFFICE的最大优势
作者:
tmtony
时间:
2004-6-10 07:43
Outlook同样可以编程,不过 Forms及对象与其它Office组件稍些不同. 程序主要用到MAPI
作者:
solver
时间:
2004-8-14 06:34
tmtony站长:能否给个简单的outlook的编程样例,俺没接触过这玩意儿,想了解一下。谢谢!
作者:
tmtony
时间:
2004-8-14 09:11
早期在繁体下帮一个企业做过一个OUTLOOK相关的系统,摘下主要代码上来,用上了部分outlook的对象,或许知道如何入手:
Dim iPos As Integer
Dim nPrint As Integer
Dim nSend As Integer
Dim cAddress As String
Dim RetVal As Variant
On Error Resume NextIf Minute(Time()) Mod 10 = 0 Then '?Ω?丁癸?
Set myFolder = myNamespace.GetDefaultFolder(olFolderDeletedItems)
While myFolder.items.Count > 0
myFolder.items.Remove 1
'Set myItem = myFolder1.items.GetFirst
'If left(myItem.subject, 3) = cpFaxHead Then
' myItem.Delete
'End If
Wend
FileSystem.Kill "c:\fax\*.*"
End If
Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set myItems = myFolder.items
' Set myApptItem = myItems("代刚")
nitemcount = myItems.CountIf nitemcount < npRecord + 1 Then
nstartcount = 1
Else
nstartcount = nitemcount - npRecord
End IfFor j = nstartcount To nitemcount '碻吏┮Τ程穝秎ン
Set myApptItem = myItems(j)
' DoEvents
' MsgBox myApptItem.sendername
' MsgBox myApptItem.replyRecipient.Name
MsgBox myApptItem.userproperties.Count & myApptItem.subject
MsgBox "5"
MsgBox myApptItem.userproperties.Count
MsgBox myApptItem.userproperties("矪瞶?篈") & "矪瞶?篈"
If myApptItem.userproperties.Count = 0 Then '?狦礚?笆矪瞶夹в
MsgBox "6"
Set myForward = myApptItem.Forward
' Set myProp = myApptItem.userproperties.Add("?笆矪瞶夹в", 6)
' myProp.Value = True
MsgBox "7"
Set myProp = myApptItem.userproperties.Add("矪瞶?篈", 1)
MsgBox "8"
myProp.Value = ""
myApptItem.Save
MsgBox "9"
MsgBox myApptItem.userproperties.Count & myApptItem.subject
' Set myForward = myApptItem.Forward
' If left(myApptItem.subject, 3) <> cpFaxHead Then '?耞琌?肚痷
If InStr(myApptItem.subject, cpFaxHead) = 0 Then '?耞琌?肚痷
'讽秎ン琌 ╰参岿粇,秎ン⊿祇癳??, ┪ 蛤萝癸よΤ??┪秎ンΤ?盚???秎ン, 玥穦?岿, 叫э秈.
MsgBox "10"
Set myReply = myApptItem.Reply
MsgBox "11"
MsgBox "盚ン???" & right(myReply.Recipients(1).address, 13)
If right(myReply.Recipients(1).address, 13) = "lyceum.com.hk" Or right(myReply.Recipients(1).address, 10) = "bta.net.cn" Then '?狦秎ン琌?翠癳?ㄓ?
myReply.Close (1)
nSend = 0
nPrint = 0
' 浪琩祇ン?琌?琌?翠?, ?ぃ琌,玥ぃ矪瞶. ?礚筿福??笆ゴ?. Τwinfax?ン?????笆ゴ?.
' 玂靡?﹚琌?矪瞶?秎ン? 盢摸?跑??锣
nCount = myApptItem.Recipients.Count
'?э? for each粂?
For i = 1 To nCount '碻吏┮ΤΜン?
cAddress = myApptItem.Recipients(i).Name
MsgBox "Μン???" & cAddress
If left(cAddress, 1) = "'" Then
cAddress = Mid(cAddress, 2)
End If
If right(cAddress, 1) = "'" Then
cAddress = left(cAddress, Len(cAddress) - 1)
End If
MsgBox "⊿蠢传ぇ玡??" & cAddress
If left(cAddress, 1) = "Z" Then '??材???z
'?耞琌??甧ド甋のirene
'--------------2002?5る4ら?э---tony---------------------
cAddress = Replace(cAddress, "\ ", "") '蠢传奔ń??は弊?
cAddress = Replace(cAddress, " (", "(") '蠢传奔????? ?ireneㄓ?秎ン
cAddress = Replace(cAddress, ") ", ")") '蠢传奔璣ゅ珹腹?场?いゅ珹腹
cAddress = Replace(cAddress, "(筿?秎ン)", " (筿?秎ン)")
作者:
jzwwpp
时间:
2004-8-19 19:32
代码该如何在outlook中编辑呢????怎么找不到vb编辑器
作者:
tmtony
时间:
2004-8-20 16:46
菜单"工具"--->"宏"---->"VB编辑器"
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3