Send Object Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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"
 
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, _
"(e-mail address removed)", , , "Report", "All Please find attached", False
 
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, "(e-mail address removed)", , , "Report", strMsg, False

HTH
Dale
 
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,
_
"(e-mail address removed)", , , "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"
 
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"
 
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>
 

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

Back
Top