Sendobject is freaking me out!!!

dgm

Registered User.
Local time
Tomorrow, 10:06
Joined
Sep 5, 2002
Messages
146
This is very weird! Here is my code:
Code:
    Dim strEmailAdd, strBody, strSubject As String    

    strBody = "The following is your username"
    strEmailAdd = "test@somewhere.com.au"
    strSubject = "Database"

    DoCmd.SendObject , , , strEmailAdd, , , strSubject, strBody, False
With strBody set to these values:
strBody = "The following is your anylongword"
strBody = "The following is your usernam"
strBody = "The following is your username"
strBody = "The following is your hippopotomus"
strBody = "The following is your whyme????"
strBody = "The following is your now this just don't make sense"
strBody = "The following is your nowthisjustdon'tmakesense"
strBody = "The following is your nowthisjustdontmakesense"


I get this error: "This program has performed an illegal operation and will shut down."

However these values are fine:
strBody = "The following is your blah blah"
strBody = "The following is your insert any word here"
strBody = "The following is your user"
strBody = "The following is your usern"
strBody = "The following is your userna"
strBody = "The following is your sevench"
strBody = "The following is your sevenchrs"
strBody = "The following is your sevenchrslongandthensome"
strBody = "The following is your HelpMePlease"


Does anybody see the logic of this?:confused:

This is not random, if I repeat the same values more then once I get the same result. And the mail always gets sent regardless! The error comes up after I press yes on the security popup.

Dave
 
Dave,

Code seems OK. I copied and pasted (changing only the value of strEmailAdd) and it worked fine on a W2K machine with Office 2000.

Also, while I don't think this is relevant, your first two variables are being declared as variants. Last: I don't receive a "security popup."

Hang in there.

Tim
 
Last edited:
Thanks Mate,

I changed my code to use automation, and it works fine now using the exact same string that caused the initial problem.:confused:

Thanks for the tip about the declaration. I generally use seperate lines, I just changed it for the forum. But I was under the (mistaken) impression that I was declaring all three variables as strings, so thanks.

I'm using a Win 98 Machine with Office 2000, I think the security thing is a patch/update/service pack (It's a work computer).

I guess the problem could be any number of things. Maybe a problem with my database file.

Dave
 
Blame it on the hippopotomus.

Regards,
Tim
 
Thank You!

This worked great. I got the stupid runtime error '2293' when I was trying to send a form via email (wouldn't have worked anyway, I wanted information from a subform), but thanks for putting up this code to send this object, this works great. I'll just be sending text out using this function.
 

Users who are viewing this thread

Back
Top Bottom