Sending Email in txt format

B

Bob Vance

Is it possible that this report can open then close then send it to email
reciepent in .txt format?
Also can Subject: "Horse Billing Details" be added

Private Sub cmdShowBillEmail_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String
stDocName = "HorseInfoOwner"

DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acReport, stDocName

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:

Resume Exit_Command12_Click
End Sub
 
A

Arvin Meyer MVP

Change your SendObject line from:

DoCmd.SendObject acReport, stDocName

to:

DoCmd.SendObject acReport, stDocName, acFormatTXT
 
B

Bob Vance

Thanks Arvin, can I add a subject line as well and close the report in this
string?

Arvin Meyer MVP said:
Change your SendObject line from:

DoCmd.SendObject acReport, stDocName

to:

DoCmd.SendObject acReport, stDocName, acFormatTXT

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



Bob Vance said:
Is it possible that this report can open then close then send it to email
reciepent in .txt format?
Also can Subject: "Horse Billing Details" be added

Private Sub cmdShowBillEmail_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String
stDocName = "HorseInfoOwner"

DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acReport, stDocName

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:

Resume Exit_Command12_Click
End Sub
 
A

Arvin Meyer MVP

Sure, the full syntax is:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc][, subject][, messagetext][, editmessage][, templatefile]

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Bob Vance said:
Thanks Arvin, can I add a subject line as well and close the report in
this string?

Arvin Meyer MVP said:
Change your SendObject line from:

DoCmd.SendObject acReport, stDocName

to:

DoCmd.SendObject acReport, stDocName, acFormatTXT

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



Bob Vance said:
Is it possible that this report can open then close then send it to
email reciepent in .txt format?
Also can Subject: "Horse Billing Details" be added

Private Sub cmdShowBillEmail_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String
stDocName = "HorseInfoOwner"

DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acReport, stDocName

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:

Resume Exit_Command12_Click
End Sub
 
B

Bob Vance

Thanks Arvin, Got ot going except having truoble filtering it to the Query!
Regards Bob

'DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"

DoCmd.SendObject acSendReport, stDocName, acFormatTXT,
"qHorseNameSourceAddModifyAll.HorseID=Forms!frmHorseInfo!HorseID", , ,
"Horse Address", "You can send Accounts to this address"

Arvin Meyer MVP said:
Sure, the full syntax is:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc][, subject][, messagetext][, editmessage][, templatefile]

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Bob Vance said:
Thanks Arvin, can I add a subject line as well and close the report in
this string?

Arvin Meyer MVP said:
Change your SendObject line from:

DoCmd.SendObject acReport, stDocName

to:

DoCmd.SendObject acReport, stDocName, acFormatTXT

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com




Is it possible that this report can open then close then send it to
email reciepent in .txt format?
Also can Subject: "Horse Billing Details" be added

Private Sub cmdShowBillEmail_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String
stDocName = "HorseInfoOwner"

DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acReport, stDocName

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:

Resume Exit_Command12_Click
End Sub
 
B

Bob Vance

Thanks Arvin , worked it out :) ... Regards Bob
DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acSendReport, stDocName, acFormatTXT, , , ,
"Horse/Client Billing Infomation", "You can send Accounts here for this
Horse" & Chr(10) & Chr(10) & "Best Regards" & Chr(10) &
Nz(DLookup("[EmailName]", "tblCompanyInfo") & Chr(10) &
Nz(DLookup("[CompanyName]", "tblCompanyInfo"), ""))

Bob Vance said:
Thanks Arvin, Got ot going except having truoble filtering it to the
Query! Regards Bob

'DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"

DoCmd.SendObject acSendReport, stDocName, acFormatTXT,
"qHorseNameSourceAddModifyAll.HorseID=Forms!frmHorseInfo!HorseID", , ,
"Horse Address", "You can send Accounts to this address"

Arvin Meyer MVP said:
Sure, the full syntax is:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc][, subject][, messagetext][, editmessage][, templatefile]

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Bob Vance said:
Thanks Arvin, can I add a subject line as well and close the report in
this string?

Change your SendObject line from:

DoCmd.SendObject acReport, stDocName

to:

DoCmd.SendObject acReport, stDocName, acFormatTXT

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com




Is it possible that this report can open then close then send it to
email reciepent in .txt format?
Also can Subject: "Horse Billing Details" be added

Private Sub cmdShowBillEmail_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String
stDocName = "HorseInfoOwner"

DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acReport, stDocName

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:

Resume Exit_Command12_Click
End Sub
 
B

Bob Vance

Arvin is there any way I can show the result of this in my Body Text, being
a horse name
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
Regards Bob Vance

Bob Vance said:
Thanks Arvin , worked it out :) ... Regards Bob
DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acSendReport, stDocName, acFormatTXT, , , ,
"Horse/Client Billing Infomation", "You can send Accounts here for this
Horse" & Chr(10) & Chr(10) & "Best Regards" & Chr(10) &
Nz(DLookup("[EmailName]", "tblCompanyInfo") & Chr(10) &
Nz(DLookup("[CompanyName]", "tblCompanyInfo"), ""))

Bob Vance said:
Thanks Arvin, Got ot going except having truoble filtering it to the
Query! Regards Bob

'DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"

DoCmd.SendObject acSendReport, stDocName, acFormatTXT,
"qHorseNameSourceAddModifyAll.HorseID=Forms!frmHorseInfo!HorseID", , ,
"Horse Address", "You can send Accounts to this address"

Arvin Meyer MVP said:
Sure, the full syntax is:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][,
cc][, bcc][, subject][, messagetext][, editmessage][, templatefile]

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Thanks Arvin, can I add a subject line as well and close the report in
this string?

Change your SendObject line from:

DoCmd.SendObject acReport, stDocName

to:

DoCmd.SendObject acReport, stDocName, acFormatTXT

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com




Is it possible that this report can open then close then send it to
email reciepent in .txt format?
Also can Subject: "Horse Billing Details" be added

Private Sub cmdShowBillEmail_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String
stDocName = "HorseInfoOwner"

DoCmd.OpenReport "HorseInfoOwner", acViewPreview, ,
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
DoCmd.SendObject acReport, stDocName

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:

Resume Exit_Command12_Click
End Sub
 
A

Arvin Meyer MVP

Bob Vance said:
Arvin is there any way I can show the result of this in my Body Text,
being a horse name
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
Regards Bob Vance

If the HorseID is a combo box, you can use the column property. Say it's the
second column:

Forms!frmHorseInfo!HorseID.Column(1)

If it isn't a combo, you can pull a recordset and get the value from that.
 
B

Bob Vance

Thanks Arvin, It is a text box on HorseInfo that is tbName if it does not
have a name then it will name it from its breeding
,tbFatherName,tbMotherName and so on, so is it still possible to get the
name into the body of the email..Regards Bob

=IIf([tbName].[Value]="" Or IsNull([tbName].[Value]),[tbFatherName].[Value]
& "--" & [tbMotherName].[Value] & " " & [tbAge].[Value] & " " &
[cbSex].[Value],[tbName].[Value])

Arvin Meyer MVP said:
Bob Vance said:
Arvin is there any way I can show the result of this in my Body Text,
being a horse name
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
Regards Bob Vance

If the HorseID is a combo box, you can use the column property. Say it's
the second column:

Forms!frmHorseInfo!HorseID.Column(1)

If it isn't a combo, you can pull a recordset and get the value from that.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
A

Arvin Meyer MVP

Yes. and you don't need to specify the .Value property as it is the default
property of a textbox. so just use:

Me.tbFatherName

etc,
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Bob Vance said:
Thanks Arvin, It is a text box on HorseInfo that is tbName if it does not
have a name then it will name it from its breeding
,tbFatherName,tbMotherName and so on, so is it still possible to get the
name into the body of the email..Regards Bob

=IIf([tbName].[Value]="" Or
IsNull([tbName].[Value]),[tbFatherName].[Value] & "--" &
[tbMotherName].[Value] & " " & [tbAge].[Value] & " " &
[cbSex].[Value],[tbName].[Value])

Arvin Meyer MVP said:
Bob Vance said:
Arvin is there any way I can show the result of this in my Body Text,
being a horse name
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
Regards Bob Vance

If the HorseID is a combo box, you can use the column property. Say it's
the second column:

Forms!frmHorseInfo!HorseID.Column(1)

If it isn't a combo, you can pull a recordset and get the value from
that.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
B

Bob Vance

Thanks Arvin BRILLIANT! Bob

Arvin Meyer MVP said:
Yes. and you don't need to specify the .Value property as it is the
default property of a textbox. so just use:

Me.tbFatherName

etc,
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Bob Vance said:
Thanks Arvin, It is a text box on HorseInfo that is tbName if it does not
have a name then it will name it from its breeding
,tbFatherName,tbMotherName and so on, so is it still possible to get the
name into the body of the email..Regards Bob

=IIf([tbName].[Value]="" Or
IsNull([tbName].[Value]),[tbFatherName].[Value] & "--" &
[tbMotherName].[Value] & " " & [tbAge].[Value] & " " &
[cbSex].[Value],[tbName].[Value])

Arvin Meyer MVP said:
Arvin is there any way I can show the result of this in my Body Text,
being a horse name
"[qHorseNameSourceAddModifyAll.HorseID]=Forms!frmHorseInfo!HorseID"
Regards Bob Vance

If the HorseID is a combo box, you can use the column property. Say it's
the second column:

Forms!frmHorseInfo!HorseID.Column(1)

If it isn't a combo, you can pull a recordset and get the value from
that.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 

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