Send Object Macro

H

Hawksby

My problem is that when writing the body of the message in the macro the text
appears on the same line on the email. Is there away of getting the text to
appear paragraphed, i.e.

Instead of:

All, Please find attached

I would like

All,

Please find attached
 
A

Arvin Meyer [MVP]

Using code it is easy. With a macro, I'm not sure, but I doubt it.

In code you would use:

Dim strMsg As String

strMsg = "All, " & vbCrLf & vbCrLf & "Please find attached"
 
H

Hawksby

Thanks for that Arvin, unfortunately i'm not the best with code. I have the
following but i'm not sure where i would add the below:

Sub Fixed_Income_Portugal()

DoCmd.SendObject acSendQuery, "Fixed Income Sales - Portugal", acFormatXLS, _
"[email protected]", , , "Report", "All Please find attached", False
 
D

Dale Fye

You are on the right track, try:

Sub Fixed_Income_Portugal()

dim strMsg as string
strMsg = "All," & vbCRLF & vbcrlf & "Please find attached"

DoCmd.SendObject acSendQuery, "Fixed Income Sales - Portugal", _
acFormatXLS, "[email protected]", , , "Report", strMsg, False

HTH
Dale
 
A

Arvin Meyer [MVP]

Piece of cake:

Sub Fixed_Income_Portugal()
Dim strMsg As String

strMsg = "All, " & vbCrLf & vbCrLf & "Please find attached"

DoCmd.SendObject acSendQuery, "Fixed Income Sales - Portugal", acFormatXLS,
_
"[email protected]", , , "Report", strMsg, False

End Sub

See how easy that was? Coding in VBA, once you get over the initial deer in
the headlights reaction is very logical and relatively easy to do. If you
need help, there are plenty of folks here who'll be happy to give you a
hand.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Arvin Meyer said:
Using code it is easy. With a macro, I'm not sure, but I doubt it.

In code you would use:

Dim strMsg As String

strMsg = "All, " & vbCrLf & vbCrLf & "Please find attached"
 
S

Steve Schapel

In a macro, you would put like this in the Message Text argument of the
SendObject action:
="All," & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Please find attached"
 
A

Arvin Meyer [MVP]

Ah yes, I remember now. It's been about 12 years since I last wrote a macro.
Code, once you're used to it, is easier, much more powerful, quicker, both
to write in many cases, but certainly to run, can be used in queries, and
has the ability to add error handling. What's not to like? <g>
 
Top