Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email

Status
Not open for further replies.

sebell

Programmer
Oct 16, 2002
51
US
When I opt to email someone from a form this was I
currently have coded.

Code:
    Emp1 = DLookup("[Email]", "[tbl_EmployeeName]", "[EmployeeName] = [txtAssignedTo]")
    file = DLookup("[File]", "[tbl_EmployeeName]", "[EmployeeName] = [txtAssignedTo]")
    DoCmd.SendObject acReport, "rpt_EmailTask", "SnapshotFormat(*.snp)", Emp1, "", "", "NOTICE: A New Item Is In The Action Register - Please Review", file, False, ""

The problem with this is that I am getting a file name that could be up to 75 character eg. file:\\\Z:\Sherry%20Estep\Action%20Register\TMSS%20Action%20Register.mdb (I am using the %20 becuase of spaces and it was cutting the link without them in the email) and it is cutting the link off. For example, it may be cutting the link off at .mdb.

Is there anyway to have a link read 'Click here to go to your AR' but have the above link somewhere hidden behind the scenes within this statement?

Thank you in advance for your help and I hope this made sense.
 
Hi,
I've had trouble with the SendObject, so I've moved my code to the Outlook "mailItem". (be sure to add the Microsoft Outlook #.0 Object Library reference) Here is the code I am using:

'*********** CODE STARTS HERE *********************
Dim UserName As String, varOutlook As Object, intImportance As Integer
Dim strSubjectLine As String
Dim strMemoLine As String

' set importance level to HIGH
intImportance = 2


strSubjectLine = "CONTACT - DUE: " & Contact_FollowUpDueDate & ", " & Contact_Subject.Value

strMemoLine = "Contact from " & cmbMemberName & ", SSN#: " & SSN
strMemoLine = strMemoLine & vbCrLf & vbCrLf
strMemoLine = strMemoLine & "Contact made at " & Contact_DateTime & ", via " & Contact_Type

Dim myApp As New Outlook.Application
Dim myItem As Outlook.MailItem
Set myItem = myApp.CreateItem(olMailItem)
With myItem
.Importance = intImportance
.To = Contact_FollowUpPerson.Column(1)
.Subject = strSubjectLine
.ReadReceiptRequested = False
.Body = strMemoLine
End With
myItem.Send
'************** END OF CODE *******************

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top