See Code Syntax Below, Change E Mail Body to Subject ?

D

Dave Elliott

I would like to instead of inserting Gulf Coast Electric into the body, put
it in the Subject instead !
Can this be done ?

DoCmd.SendObject acSendNoObject, "FormTyp", acFormatHTML, [Text173], , , ,
"From Gulf Coast Electric", True, ""
 
C

Cheryl Fischer

Dave,

Yes, you can move the Message Text argument to the Subject Argument. The
order of arguments for SendObject() is:

SendObject(ObjectType, _
ObjectName, _
OutputFormat, _
To, _
Cc, _
Bcc, _
Subject, _
MessageText, _
EditMessage, _
TemplateFile)

So, just put the text "From Gulf Coast Electric" in the appropriate
position.
 
D

Dave Elliott

So exactly how do I or where do I change the code so that this works,
confused ?
See Code Below

Thanks,

Dave

Cheryl Fischer said:
Dave,

Yes, you can move the Message Text argument to the Subject Argument. The
order of arguments for SendObject() is:

SendObject(ObjectType, _
ObjectName, _
OutputFormat, _
To, _
Cc, _
Bcc, _
Subject, _
MessageText, _
EditMessage, _
TemplateFile)

So, just put the text "From Gulf Coast Electric" in the appropriate
position.



--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Dave Elliott said:
I would like to instead of inserting Gulf Coast Electric into the body, put
it in the Subject instead !
Can this be done ?

DoCmd.SendObject acSendNoObject, "FormTyp", acFormatHTML, [Text173], , , ,
"From Gulf Coast Electric", True, ""
 
R

Rick Brandt

Dave Elliott said:
So exactly how do I or where do I change the code so that this works,
confused ?
See Code Below

Dave, Go to Tools - Options - Module and see if the "Auto-" options are enabled
under coding options. With these enabled, as you type the command in a VBA
window you will get text displayed on screen telling exactly what each argument
position you are in based on the commas separating the arguments. You should be
able to "arrow" through the statement until it tells you that you are positioned
at the Argument you want. Your original syntax simply has one too many commas
in front of your text and needs it moved after it.
 
C

Cheryl Fischer

Dave,

Look at your current function call. Those commas with nothing behind them
are argument markers, which have to be there so that the function will know
what your variables mean. When you see that there are no values between
these commas, that denotes that an optional argument could have been
inserted there but was not.

So, cut your text "From Gulf Coast Electric" from its current position in
your function - *leaving the comma* - and paste it back into your function
in the position reserved for Subject. Here is a representation using your
argument values:

DoCmd.SendObject acSendNoObject, "FormTyp", acFormatHTML, _
[Text173], <leave blank if no CC>, <leave blank if no BCC>, _
<leave blank if no Subj> , "From Gulf Coast Electric", True, ""




--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Dave Elliott said:
So exactly how do I or where do I change the code so that this works,
confused ?
See Code Below

Thanks,

Dave

Cheryl Fischer said:
Dave,

Yes, you can move the Message Text argument to the Subject Argument. The
order of arguments for SendObject() is:

SendObject(ObjectType, _
ObjectName, _
OutputFormat, _
To, _
Cc, _
Bcc, _
Subject, _
MessageText, _
EditMessage, _
TemplateFile)

So, just put the text "From Gulf Coast Electric" in the appropriate
position.



--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Dave Elliott said:
I would like to instead of inserting Gulf Coast Electric into the
body,
put
it in the Subject instead !
Can this be done ?

DoCmd.SendObject acSendNoObject, "FormTyp", acFormatHTML, [Text173], ,
,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top