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

Using Sendobject in Macro

Status
Not open for further replies.

bdjb

Technical User
Oct 29, 2002
292
US
Hello,
I'm using the Sendobject (Access 2002)function within a Macro to send an email to Lotus Notes (version 6.5). It opens Notes fine, and attaches the file, but the TO field doubles the person's name. We have to manually delete one, then click on send. (Can the send be automated as well)?

Thanks

What happens if you get scared half to death twice?

Bob
 
Save the macro as code and post it here, someone may be able to help. SendObject has an Edit Message argument, have you set it to false?
 
I'm having the same problem with my Access macro using the sendobject in Lotus notes that "bdjb" was having. I have the edit message set to no. Any help would be greatly appreciated.

Thanks.
 
Save the macro as code and post it here, someone may be able to help.
 
Hello,
I didn't figure out the sendmail issue, but with help from various places around the 'net, I set this code in an Access Module. You can then call it from a macro.

Public Function Mail_Function()

Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object

Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.GETDATABASE("test.nsf", "")
Call notesdb.OPENMAIL

'Rem make new mail message
Set notesdoc = notesdb.CREATEDOCUMENT
Call notesdoc.replaceitemvalue("Sendto", "test@test.com")
Call notesdoc.replaceitemvalue("Subject", "Billing detail Summary by Customer Number by ItemID Excel Spreadsheet")
Set notesrtf = notesdoc.CREATERICHTEXTITEM("body")

Call notesrtf.appendtext("The Data is attached")
Call notesrtf.addnewline(2)

'Rem attach Error Report doc - change the sample.xls to the name of your file
Call notesrtf.EMBEDOBJECT(1454, "", "C:\Billing detail Summary by Customer Number by ItemID.xls", "")

'Rem send message
notesdoc.SAVEMESSAGEONSEND = True
Call notesdoc.SEND(False)
Set notessession = Nothing

'Rem this deletes the file after it is sent
Kill ("C:\Billing detail Summary by Customer Number by ItemID.xls")

End Function


What happens if you get scared half to death twice?

Bob
 
I cannot see how this could be working with SendObject. If you want to send immediately, I imagine you need to change:

Call notesdoc.SEND(False)

To

Call notesdoc.SEND(True)
 
Is there a way to Reset the autonumber to 0 on Append Query without having to compact and repair the database? (I want to delete the previous records)

Because of this I can NOT set up a macro to run.

Any help would be greatly appreciated.
 
Resetting an autonumber is rarely a good idea. Here is a link, please read the various links posted by Zameer Abdulla:

Auto Number Reset
thread700-1098238
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top