Results 1 to 10 of 10
  1. #1
    kevins is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    26

    SendObject Message Character Limit

    Hello,

    I have a button to send automatic emails confirming interview times. The action works well, but I've reached the alotted number of characters and I'd like to add more text to the message body. Any ideas on extending the text limit? Code below:

    =[First Name] & "," & Chr(13) & Chr(13) & "It was a pleasure speaking with you today. We are confirmed to meet in the Harper Associates office on " & [Date Interviewed @ Harper] & " at " & [Harper Interview Time] & "." & Chr(13) & Chr(13) & Chr(13)

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What's your actual code behind the button? I've sent emails a lot longer than what you have there.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    kevins is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    26
    I actually don't really know VBA at all, it was a macro that I used. In the macro I have:

    TO: =[Contact Name] & IIf(Nz([E-mail Address])<>""," [" & [E-mail Address] & "]")
    SUBJECT: Meeting Confirmed at Harper Associates
    MESSAGE TEXT: =[First Name] & "," & Chr(13) & Chr(13) & "It was a pleasure speaking with you today. We are confirmed to meet in the Harper Associates office on " & [Date Interviewed @ Harper] & " at " & [Harper Interview Time] & "." & Chr(13) & Chr(13) & Chr(13)

    It stops me when I try to continue the message text.

    Thanks for your help!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sorry, I don't use macros. I assume they have that limitation. Here's a brief code test that got up to 693 characters in the body. You might see if it works for you:

    Code:
      Dim strBody                 As String
      Dim strTo                   As String
    
      strBody = "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf _
              & "Testing a really long body here" & vbCrLf
    
      Debug.Print Len(strBody)
      strTo = [Contact Name] & IIf(Nz([E-mail Address]) <> "", " [" & [E-mail Address] & "]")
      DoCmd.SendObject , , , strTo, , , "Meeting Confirmed at Harper Associates", strBody, True
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    kevins is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    26
    Thanks Paul,

    I applied that code to the button and nothing seems to be happening. Any ideas? Someday I'll figure out VBA lol.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is any VBA code running? The database needs to be in a trusted location or you have to explicitly enable code. Typically there's an option to do so right under the ribbon.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    kevins is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    26
    Click image for larger version. 

Name:	VBA.jpg 
Views:	9 
Size:	170.1 KB 
ID:	8515 Ok thanks, that got me somewhere, but an error popped up "Compile Error: Argument not Optional"

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I just copy/pasted your function. Try this:


    strTo = [Contact Name] & IIf(Nz([E-mail Address]) <> "", " [" & [E-mail Address] & "]", "")

    or simply

    strTo = [E-mail Address]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    kevins is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    26
    Paul,

    Thank you thank you! This works beautifully. Your help is much appreciated!

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Excellent! Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 16
    Last Post: 10-13-2011, 07:52 AM
  2. Replies: 5
    Last Post: 05-18-2011, 11:02 AM
  3. Text Box control and character limit?
    By Bigdoggit in forum Forms
    Replies: 2
    Last Post: 03-29-2011, 10:05 AM
  4. Replies: 4
    Last Post: 10-07-2010, 09:42 AM
  5. SendObject Message
    By williammarino in forum Forms
    Replies: 4
    Last Post: 10-06-2009, 01:54 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums