Hi,

I want an email to be sent, which contains a link to the workbook once a user has filled in a userform and clicks a button on the userform. I have the following code:


Dim outapp As Object
Dim outmail As Object

Set outapp = GetObject("outlook.application")
If outapp Is Nothing Then Set outapp = CreateObject("outlook.application")

outapp.session.logon
Set outmail = outapp.createitem(0)

On Error Resume Next
With outmail
    .to = "example@hotmail.com"
    .cc = ""
    .bcc = ""
    .Subject = "Number" & UserForm2.TextBox1.Text
    .Body = "Hi," & vbCrLf & _
        "I need you to verify details below" & vbCrLf & _
        "<file:///c:\\NameOfWorkbook>" & vbCrLf & _
        "Thanks," & vbCrLf & vbCrLf _
    .send
    .Readreceiptrequested = False
End With
outmail.display

End Sub
However, I'm always getting invalid qualifier or variable not defined. Could someone please help? Thanks in advance! =)