搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Convert VBA on Outlook to TBird

  • 無回覆
  • 0 有這個問題
more options

Can this be doctored to send via Thunderbird? If so pointers would be apreciated! Sub FredWeeklyReport() Dim OutApp As Object

   Dim OutMail As Object
   Dim MyAddress As String
   Dim MyAddress2 As String
   Dim Response
   Set OutApp = CreateObject("Outlook.Application")
   Set OutMail = OutApp.CreateItem(0)
   On Error Resume Next
   
   Response = MsgBox("Fred. Hide all invoices, check worksheet is up to date", vbOKCancel)
   If Response = vbCancel Then GoTo ExitLable
   'Worksheets("Sheet19").Visible = False
   MyAddress = Sheets("Work summary").Range("Eddress1").Value
   MyAddress2 = Sheets("Work summary").Range("Eddress2").Value
   With OutMail
       .To = MyAddress
       '.CC = MyAddress2
       .BCC = ""
       .Subject = "Fred - PM - Weekly report"
       .Body = "Attached please find my weekly report. Regards, Peter"
       .Attachments.Add ActiveWorkbook.FullName
       'You can add other files also like this
       '.Attachments.Add ("C:\test.txt")
       .Send   'or use .Display
   End With
   On Error GoTo 0

ExitLable:

   Set OutMail = Nothing
   Set OutApp = Nothing

End Sub

Can this be doctored to send via Thunderbird? If so pointers would be apreciated! Sub FredWeeklyReport() Dim OutApp As Object Dim OutMail As Object Dim MyAddress As String Dim MyAddress2 As String Dim Response Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) On Error Resume Next Response = MsgBox("Fred. Hide all invoices, check worksheet is up to date", vbOKCancel) If Response = vbCancel Then GoTo ExitLable 'Worksheets("Sheet19").Visible = False MyAddress = Sheets("Work summary").Range("Eddress1").Value MyAddress2 = Sheets("Work summary").Range("Eddress2").Value With OutMail .To = MyAddress '.CC = MyAddress2 .BCC = "" .Subject = "Fred - PM - Weekly report" .Body = "Attached please find my weekly report. Regards, Peter" .Attachments.Add ActiveWorkbook.FullName 'You can add other files also like this '.Attachments.Add ("C:\test.txt") .Send 'or use .Display End With On Error GoTo 0 ExitLable: Set OutMail = Nothing Set OutApp = Nothing End Sub

如果您還沒有帳號,您必須先登入帳號 來回覆文章。還沒有帳號的話,只能發問新問題