下面是microsoft visual basic help中outlook - saveas中的一个例子, 但当文件名是re:或者fw:这样带":"的名字的时候,outlook就不能保存信件了,请问应该怎么解决这个问题?(我看outlook在saveas保存的时候会自动把“:”去掉) Sub SaveAsTXT() Dim myItem As Outlook.Inspector Dim objItem As Object Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.ActiveInspector If Not TypeName(myItem) = "Nothing" Then Set objItem = myItem.CurrentItem strname = objItem.Subject 'Prompt the user for confirmation Dim strPrompt As String strPrompt = "Are you sure you want to save the item? If a file with the same name already exists, it will be overwritten with this copy of the file." If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbYes Then objItem.SaveAs "C:\" & strname & ".txt", olTXT End If Else MsgBox "There is no current active inspector." End If End Sub |