Thank you all for the quick and resourceful info.
But my puzzle now is how do I include the Mac address on my email form so that when a mail is sent, it will copy the Mac address of the current machine and send at the same time.
Here's my email sending code:
Private Sub cmdSend_Click()
On Error Resume Next
Dim oApp As Object
Dim oEmail As Object
Dim FSO As New FileSystemObject
Dim FolderPath As String
Dim FileName As String
Set oApp = CreateObject("Outlook.Application")
Set oEmail = oApp.CreateItem(0)
oEmail.To = Nz(Me.txtTo.Value, "")
oEmail.Subject = Nz(Me.txtSubjet.Value, "")
oEmail.Body = Nz(Me.txtBody.Value, "")
If FSO.FileExists(Nz(Me.txtAttachment.Value, "")) Then
FolderPath = CurrentProject.Path & "\Attachments"
If Not FSO.FolderExists(FolderPath) Then
FSO.CreateFolder FolderPath
End If
FSO.CopyFile Me.txtAttachment.Value, FolderPath & "", True
FileName = FSO.GetFileName(Me.txtAttachment.Value)
oEmail.Attachments.Add FolderPath & "" & FileName
End If
' If Len(Me.txtAttachment) > 0 Then
' oEmail.Attachments.Add Me.txtAttachment.Value
' End If
With oEmail
If Not IsNull(.To) And Not IsNull(.Subject) And Not IsNull(.Body) Then
.Send
Logging.WriteLog "Email Sent=To: " & Nz(Me.txtTo, "") _
& " Subject: " & Nz(Me.txtSubjet, "") _
& " Body: " & Nz(Me.txtBody, "") _
& " Attachment: " & Nz(Me.txtAttachment, "")
MsgBox "Email Sent!"
Else
MsgBox "Please Fill Out the Required Fields"
End If
End With
End Sub
Please help me to include the GetMacAddress() on where it's appropriate in this code above.
Regards,
Moore71