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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing from Access 97

Status
Not open for further replies.

RCorrigan

MIS
Feb 24, 2004
2,872
MT
I have the following in place

Code:
Private Sub cmdEMail_Click()

    Dim email As String
    Dim ref As String
    Dim sender As String
    Dim System As String
    Dim header As String
    Dim body As String
    Dim expectdate As String
    
    
    Dim objOutlook As Outlook.Application
    Dim objEMail As Outlook.MailItem
    
    email = Me!Requestor
    ref = Me!txtTicketNum
    sender = Me!Combo14
    System = Me!System
    header = "User Access Authorised Addition/Amendment"
    body = Me!txtComments
    expectdate = Me!cboExpectDate
    
    Set objOutlook = CreateObject("outlook.application")
    Set objEMail = objOutlook.CreateItem(olMailItem)
           
    
    With objEMail
        .To = email
        .Subject = System & " " & header & " " & "Ticket Number" & " " & ref
        .body = body & " " & vbCrLf & vbCrLf & "Expected Completion Date is" & " " & expectdate
        .Save
        .Send
        
    End With
    
    
    
End Sub

This worked for me yesterday, but today I get the following message when I click my cmd button

Code:
Compile Error - Can't find project or library
and when I click yes [COLOR=red yellow]olMailItem[/color] is the section highlighted.

Help !!!!!

MTIA

<Do I need A Signature or will an X do?>
 
If nothing changed in your code, is it possible that the .dll file got deleted somehow for the Outlook reference?
 
I have tried running this from another PC and it does exactly the same.

I've checked that the outlook library is referenced - which it is - but which .dll and where ???

<Do I need A Signature or will an X do?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top