Results 1 to 6 of 6
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    SendObject Length Limitation (A2003)

    Quick question on using Send Object

    Per users request, I am using code to create a string of names to create an email for. I.e., Joe@xyx.com, sally@aaa.com, Tom@bbb.com. The
    string of names is assigned to Variable ToName. ToName is dimensioned as a string.

    Executing the docmd.sendobject statement (below) works properly.

    DoCmd.SendObject acSendNoObject, , , ToName, , , "Required SOP Training", "Input Message", -1

    However, the issue is that the string ToName can exceed 255 characters such that the email To data is truncated to 255 in the email and any characters after 255 are not populated.

    Is there a workaround to get the full ToName string to pass into the To field if its length exceeds 255 when using SendObject?

    I can use mailing lists but the users want a visible record of whom the email was sent to, not just the mailing list. By the way, the email system is Lotus Notes.
    Regards,

    Gary
    (It's been a while!)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SendObject Length Limitation (A2003)

    The only workaround I can think of is to break the ToName string into pieces not exceeding 255 characters in length, and to call DoCmd.SendObject for each piece.

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: SendObject Length Limitation (A2003)

    Thanks Hans,

    But wouldn't doing that create two or more email documents instead of one?

    As an alternative, I figured I could use the CC and BCC fields so 765 characters would be available.

    I also looked at another post to work with Lotus Notes directly in code that I may go back to but I had problems with the code executing (not the code but our setup).

    I think I will check the outlook boards to see how to programatically populate the data and see if I can get it to work.

    Thanks for your help.
    Regards,

    Gary
    (It's been a while!)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SendObject Length Limitation (A2003)

    I'm afraid I can't help you with automating Lotus Notes, so good luck.

  5. #5
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SendObject Length Limitation (A2003)

    again, clutching at straws...

    You say you're passing the SendTo in as a string. Have you tried passing it in as an array? Below is an outline of how I do it, but I've never gone for large distribution lists so don't really know if this will help - we tend to set up mailgroups for each automated report. In the example below, the mailgroups could contain upto 30 people each. Would that work for you?

    '~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Sub SendDailies_SAPFGI()
    Dim strSubject As String
    Dim strDistList As Variant
    Dim strBody As Variant

    strSubject = "SAPFGIReport"
    strDistList = Array("EMEA DISTRIBUTION", "AMI DISTRIBUTION", "APR DISTRIBUTION")
    strBody = Array("Today's FGI report as at 08:00 GMT" , PATH_TEXTFILES & "SAPFGIReport.txt" , "regards" , "Brooke")

    Call SendLotusNotesEmail(strDistList, strSubject, , strBody)
    End Sub
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~

    the main sub - with most code stripped out, is as below:

    '~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Sub SendLotusNotesEmail (varDistList As Variant, strSubject As String, Optional varCopyList As Variant, Optional varBody As Variant, Optional strPriority As String = "N", Optional strImportance As String = "2")

    'declare notes objects
    'declare standard variables
    'set up document
    'assign standard document values

    'assign passed document values
    doc.Subject = strSubject 'give it a subject
    doc.SendTo = varDistList 'set the SendTo field to the distribution list
    doc.CopyTo = varCopyList

    'build body of email here if you want to

    'get rid of the thing
    Call doc.SEND(False, doc.SendTo)
    Call doc.Save(False, False)

    'kill all notes references
    End Sub
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~

    HTH

  6. #6
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: SendObject Length Limitation (A2003)

    Thanks for the suggestion. I did find out about arrays while researching using lotus notes. Rather then mess with the arrays I wound up looping through the names selected and then automating the process of sending an email to each user selected one after another. This actually solved another problem in that they wanted a historical record of what was sent to whom and a timestamp of when it was sent. I have a query updating a table with this information after each email is sent. Works quite well.

    Again, thanks for the suggestion.
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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