Results 1 to 9 of 9

Thread: sendobject

  1. #1
    Join Date
    Sep 2005
    Posts
    313

    Unanswered: sendobject

    Hi
    I have a question,
    I used sendobject to send e-mail, but when I checked the e-mail, the e-mail does not show the mail I sent from MS Access. I already wait for a long time. Is the mail deleted itself?

    Thanks.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    You have obviously done something wrong. Let's see your code...

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Sep 2005
    Posts
    313
    DoCmd.SendObject acSendReport, "Approval", acFormatRTF, email, , , "Please respond to this e-mail. Thank You.", , True

    DoCmd.SendObject acSendReport, "Approval", acFormatRTF, email, , , "Please respond to this e-mail. Thank You.", , False

    DoCmd.SendObject acSendReport, "Approval", acFormatRTF, email, , , "Please respond to this e-mail. Thank You."

    I already tried these three sentences, but the program goes to the Lotus Notes, and then I need to click the Send button on Lotus Notes again. How can I skip to click Send Button from Lotus Notes.

    Thanks.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    This is the last time I'm going to answer the same question twice for you.

    Code:
    Public Function SendNotesMail(strTo As String, strSubject As String, strBody As String)
        Dim doc As Object
        Dim oSess As Object
        Dim oDB As Object
    
        Set oSess = CreateObject("Notes.NotesSession")
        Set oDB = oSess.GETDATABASE("", "")
        Call oDB.OPENMAIL
    
        Set doc = oDB.CREATEDOCUMENT
        doc.sendto = strTo
        doc.subject = strSubject
        doc.body = strBody & vbCrLf & vbCrLf
    
        doc.send False
    
    End Function
    *Don't forget to reference the notes library.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Sep 2005
    Posts
    313
    Question,

    How do I transfer the rtf format?
    Because I need to send one object approval.rtf file.

    Thanks.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Ah, you'll need to embed it as a richtextitem.

    Look here.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Sep 2005
    Posts
    313
    In the Code,

    what is 1454 in the Set Body2 = rtitem.EMBEDOBJECT(1454, "", strFilename)

  8. #8
    Join Date
    Sep 2005
    Posts
    313
    I see that. But, I want to transfer the file from MS Access to Lotus Notes directly, like sendobject acreport, "Approval", acformatRTF,.............

    The code needs to use the path name eg. g:\ta.exe
    So, do we need to create the file first and then save it in the directoy. It's too trouble.

    How to solve? I don't want to save the file in the directory.

    Dim strTo As String 'The sendee(s) Needs to be fully qualified address. Other names seperated by commas
    Dim strSubject As String 'The subject of the mail. Can be "" if no subject needed
    Dim strBody As String 'The main body text of the message. Use "" if no text is to be included.
    Dim FirstFile As String 'If you are embedding files then this is the first one. Use "" if no files are to be sent
    Dim SecondFile As String 'Add as many extra files as is needed, seperated by commas.
    Dim ThirdFile As String 'And so on.


    strTo = "Alan@hotmail.com"
    strSubject = "Test Message"
    strBody = "This is a test"
    strBody = strBody & vbCrLf & "Just add new lines by concatenating " & vbCrLf & " "

    ////// How do I change this code, because I do NOT want to create the file and store it in the p: drive, I want to transfer the file directly from MS Access to Lotus Notes//////////////
    FirstFile = "p:\Approval Amount.rtf"
    SecondFile = ""
    ThirdFile = ""


    Call SendNotesMail(strTo, strSubject, strBody, FirstFile)


    Thanks.
    Last edited by accessman2; 11-14-05 at 18:15.

  9. #9
    Join Date
    Sep 2005
    Posts
    313
    I did that.

    But, I have another problem.

    When I run it, it needs to turn on the Lotus Notes before sending.
    Because open the Lotus Notes needs password, username.

    And also, if I open the Lotus Notes, after a while, the Lotus Notes log off, but still open, run sending the e-mail, it does NOT work.

    Therefore, it works sending when the Lotus Notes is opened and stay log on the condition.

    How can I solve it? I want to send e-mail if thought I the Lotus Notes is closed or at log off condition.

    Please let me know, thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •