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

Access/Lotus Notes, SendObject isn't available

Status
Not open for further replies.

Kuru5

Technical User
Jul 28, 2008
9
0
0
CA
Sorry, I am new to Access. I have a database done in Access 97 and have opened it with Access 2007. It seems as if there were no errors from the conversion.

The problem:
There was a function on the form to set up an email on lotus notes with an attachment. After the conversion, when you hit the button, an error comes up saying "the command or action "SendObject" isn't available now". It works fine on 97 and the SendObject command still exists in 2007.

Does anyone know why this would be?

Also, we are using Lotus Notes and it is the default email program.

Thanks in advance.
 
Hello Leslie,

That's the code behind the button. Thanks for your help.


Private Sub Mail_Report_Click()
On Error GoTo Err_Mail_Report_Click

Dim stDocName As String
Dim WorkorderID As String

Forms!OrderEntry!WorkorderID.SetFocus
WorkorderID = Forms!OrderEntry!WorkorderID.Text

stDocName = "WorkOrder"
DoCmd.SendObject acReport, stDocName, acFormatRTF, , , , "Purchasing work order tracking ID:" + WorkorderID, "New work order was already entered to the system. The New Work order ID number is : " + WorkorderID + ". This ID is used for tracking your order. Thank you."




Exit_Mail_Report_Click:
Exit Sub

Err_Mail_Report_Click:
MsgBox Err.Description
Resume Exit_Mail_Report_Click

End Sub
 
did you take out the email addresses for security reasons or is this the exact code?
 
we are using Notes version 6.5

that is the exact code behind the button. I don't know if it was written or if it was generated by a wizard.
 
well, there's no email address to send to....the msdn library says this:
expression.SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile)
To
Optional
Variant
A string expression that lists the recipients whose names you want to put on the To line in the mail message. Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon (;) or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel. If the recipient names aren't recognized by the mail application, the message isn't sent and an error occurs. If you leave this argument blank, Microsoft Access prompts you for the recipients.

what if you put your email address in as an argument, does it work then?
Code:
Private Sub Mail_Report_Click()
On Error GoTo Err_Mail_Report_Click

    Dim stDocName As String
    Dim WorkorderID As String
    
    Forms!OrderEntry!WorkorderID.SetFocus
    WorkorderID = Forms!OrderEntry!WorkorderID.Text
    
    stDocName = "WorkOrder"
    DoCmd.SendObject acReport, stDocName, acFormatRTF, [b]youremailaddress@somedomain.com[/b], , , "Purchasing work order tracking ID:" + WorkorderID, "New work order was already entered to the system. The New Work order ID number is : " + WorkorderID + ". This ID is used for tracking your order. Thank you."
    
    
    

Exit_Mail_Report_Click:
    Exit Sub

Err_Mail_Report_Click:
    MsgBox Err.Description
    Resume Exit_Mail_Report_Click
    
End Sub


Leslie

Have you met Hardy Heron?
 
putting the email in as an arguement gives a compile error.

the button opens up a notes memo with the rtf as an attachment, the message, and a blank email field
 
the button opens up a notes memo with the rtf as an attachment, the message, and a blank email field

that's what it does now, or that's what it did before?
 
that is what it does when i try with access 97, when it gets converted to 2007 it pops up the message that sentobject isn't available now.

i would like to get it working on 2007 so i make runtime versions of it
 
did you put it in quotes:
Code:
Private Sub Mail_Report_Click()
On Error GoTo Err_Mail_Report_Click

    Dim stDocName As String
    Dim WorkorderID As String
    
    Forms!OrderEntry!WorkorderID.SetFocus
    WorkorderID = Forms!OrderEntry!WorkorderID.Text
    
    stDocName = "WorkOrder"
    DoCmd.SendObject acReport, stDocName, acFormatRTF, "youremailaddress@somedomain.com", , , "Purchasing work order tracking ID:" + WorkorderID, "New work order was already entered to the system. The New Work order ID number is : " + WorkorderID + ". This ID is used for tracking your order. Thank you."
    
    
    

Exit_Mail_Report_Click:
    Exit Sub

Err_Mail_Report_Click:
    MsgBox Err.Description
    Resume Exit_Mail_Report_Click
    
End Sub

Leslie

Have you met Hardy Heron?
 
nope i missed the quotes, putting the quotes in it goes back to the sendobject isn't available now message
 
what happens if you change acFormatRTF to acFormatTxt?

Leslie
 
does it work on any computer? or does it always give the error message?

I'm just googling your error message and looking to see what else is on the web that might help. I found one page that seemed to say it was the RTF, another that suggests the above.

Several have said the SendObject command is just buggy and you should use something else.

Leslie
 
thanks a lot leslie. I will keep looking on the web as well and try different things with it and post when i get something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top