|
早期在繁体下帮一个企业做过一个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, "(筿?秎ン)", " (筿?秎ン)")
|
|