這是我在這個討論區看到的程式碼 ....
Public Sub SendOutlookMail(recipient As String)
On Error GoTo errorHandler
Dim oLapp As Object
Dim oItem As Object
Set oLapp = CreateObject("Outlook.application")
Set oItem = oLapp.CreateItem(0)
With oItem
.Subject = txtsubject.text
.To = recipient
.Body = txtbody.text
.Send
End With
'
Set oLapp = Nothing
Set oItem = Nothing
'
Exit Sub
errorHandler:
Set oLapp = Nothing
Set oItem = Nothing
Exit Sub
End Sub
請問我要在哪裡加上什麼程式碼才能附加固定路徑的檔案
將信寄出去呢?
Public Sub SendOutlookMail(recipient As String)
On Error GoTo errorHandler
Dim oLapp As Object
Dim oItem As Object
Set oLapp = CreateObject("Outlook.application")
Set oItem = oLapp.CreateItem(0)
With oItem
.Subject = txtsubject.text
.To = recipient
.Body = txtbody.text
.Send
End With
'
Set oLapp = Nothing
Set oItem = Nothing
'
Exit Sub
errorHandler:
Set oLapp = Nothing
Set oItem = Nothing
Exit Sub
End Sub
請問我要在哪裡加上什麼程式碼才能附加固定路徑的檔案
將信寄出去呢?
全站熱搜
留言列表