|
楼主 |
发表于 2018-1-26 12:54
|
显示全部楼层
本帖最后由 yhy123556 于 2018-1-26 12:57 编辑
一楼的代码没贴成功貌似。
试了多种结构/代码,今天上午发现其实只要代码里]加上“Save”就可以了,没有Save的话是修改了但没保存,以下两版成功的代码贴上来供参考。
- Sub EditSingle()
- Set myfolder = Application.ActiveExplorer.CurrentFolder
- Set myItems = myfolder.Items
- For Each myItem In myItems
- myItem.Subject = Replace(myItem.Subject, "*", "")
- myItem.Subject = Replace(myItem.Subject, "!", "")
- myItem.Save
- Next
- End Sub
复制代码
- Sub EditSubject()
- Dim i As Integer
- Dim myItems As Outlook.Items
- Dim myItem As Object
- Set myItems = Application.ActiveExplorer.CurrentFolder.Items
- For i = 1 To myItems.Count Step 1
- Set myItem = myItems(i)
- With myItem
- .Subject = Replace(.Subject, "RE: ", "")
- .Subject = Replace(.Subject, "Re: ", "")
- .Subject = Replace(.Subject, "FW: ", "")
- .Save
- End With
- Next
- End Sub
复制代码 |
|