E-Mail a formatted text attachment | | |
Hi,
I'm having trouble with a specific e-mail text format attachment ...
The requirement is for the attachment to be .txt type and in this
format:
Label=FieldValue
Label=FieldValue
Label=FieldValue
Label=FieldValue
Label=FieldValue
etc., etc.,
The only way I could figure to accomplish this was to 1st do a report
in this format, but the problem I'm having is that as soon as I put the
controls too close together, the spacing between each row is not the
same - I need the each row to be directly under the other, with no line
spacing unless a space has been left on the report. The line-spacing
when viewing the report is fine, but as soon as it is e-mailed as an
attachment, the .txt attachment's line spacing is irregular - I would
really appreciate a solution to this problem. Many thanks | | | | re: E-Mail a formatted text attachment
How are you emailing this? Are you using SendObject? If so, as you've seen,
the formatting of SendObject leaves a lot to be desired. You can try the
other format types (html, rtf), but you'll likely find that they don't
render well either.
One option is to forego the attachment and include your info in the Body of
the email. You can build it like this;
Dim rst As DAO.REcordset
Dim strBody As STring
Set rst = CurrentDB.OpenRecordset("SQL statement to open the correct
record")
If Not (rst.EOF and rst.BOF) Then
strBody = "Name: : " & rst("NameField") & vbCrLf & "Address: " &
rst("AddressField") & vbcrlf & "City/State/Zip:" & rst("City") & " " &
rst("State") & ", " & rst("Zip")
End IF
DoCmd.SendObject , , , "user@user.com", , , "Subject Here", strBody, True
set rst = Nothing
Or you can build a plaintext file and use other methods to attach it ... or
print your report to PDF and send that (can't do it with SendObject, but
there are other methods available).
<brigitte@dreamafrica.co.za> wrote in message
news:1111748219.155099.265440@l41g2000cwc.googlegr oups.com...[color=blue]
> Hi,
>
> I'm having trouble with a specific e-mail text format attachment ...
>
> The requirement is for the attachment to be .txt type and in this
> format:
> Label=FieldValue
> Label=FieldValue
> Label=FieldValue
>
> Label=FieldValue
> Label=FieldValue
>
> etc., etc.,
>
> The only way I could figure to accomplish this was to 1st do a report
> in this format, but the problem I'm having is that as soon as I put the
> controls too close together, the spacing between each row is not the
> same - I need the each row to be directly under the other, with no line
> spacing unless a space has been left on the report. The line-spacing
> when viewing the report is fine, but as soon as it is e-mailed as an
> attachment, the .txt attachment's line spacing is irregular - I would
> really appreciate a solution to this problem. Many thanks
>[/color] | | | | re: E-Mail a formatted text attachment
Brigitte,
I'd probably code this using VBA's built in string manipulation and file
capabilities. Something like:
Public Function GenEMail() As Long
'Dimension variables.
'Pull list of records to be output from database
'If there are records to be output, for each record
'Label = SomeString
'FieldValue = SomeValue
'File Row (X) = Label & "=" & FieldValue
'Close & save changes to file
'DoCmd.SendObject MyFile
End Function
The exact syntax & wording of the function will be different. But the idea
is there.
<brigitte@dreamafrica.co.za> wrote in message
news:1111748219.155099.265440@l41g2000cwc.googlegr oups.com...[color=blue]
> Hi,
>
> I'm having trouble with a specific e-mail text format attachment ...
>
> The requirement is for the attachment to be .txt type and in this
> format:
> Label=FieldValue[/color] | | | | re: E-Mail a formatted text attachment brigitte@dreamafrica.co.za wrote:
[color=blue]
>I'm having trouble with a specific e-mail text format attachment ...
>
>The requirement is for the attachment to be .txt type and in this
>format:
>Label=FieldValue
>Label=FieldValue
>Label=FieldValue
>
>Label=FieldValue
>Label=FieldValue
>
>etc., etc.,
>
>The only way I could figure to accomplish this was to 1st do a report
>in this format, but the problem I'm having is that as soon as I put the
>controls too close together, the spacing between each row is not the
>same - I need the each row to be directly under the other, with no line
>spacing unless a space has been left on the report. The line-spacing
>when viewing the report is fine, but as soon as it is e-mailed as an
>attachment, the .txt attachment's line spacing is irregular - I would
>really appreciate a solution to this problem. Many thanks[/color]
What method are you using to send the email? Outlook? As others have indicated
SendObject doesn't work.
It may not be possible to format the emails as you desire. The displaying of
attachments is likely entirely at the mercy of the email client software.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at http://www.granite.ab.ca/accsmstr.htm | | | | re: E-Mail a formatted text attachment
On Fri, 25 Mar 2005 22:20:15 GMT, Tony Toews <ttoews@telusplanet.net>
wrote:
[color=blue]
>brigitte@dreamafrica.co.za wrote:
>[color=green]
>>I'm having trouble with a specific e-mail text format attachment ...
>>
>>The requirement is for the attachment to be .txt type and in this
>>format:
>>Label=FieldValue
>>Label=FieldValue
>>Label=FieldValue
>>
>>Label=FieldValue
>>Label=FieldValue
>>
>>etc., etc.,
>>
>>The only way I could figure to accomplish this was to 1st do a report
>>in this format, but the problem I'm having is that as soon as I put the
>>controls too close together, the spacing between each row is not the
>>same - I need the each row to be directly under the other, with no line
>>spacing unless a space has been left on the report. The line-spacing
>>when viewing the report is fine, but as soon as it is e-mailed as an
>>attachment, the .txt attachment's line spacing is irregular - I would
>>really appreciate a solution to this problem. Many thanks[/color]
>
>What method are you using to send the email? Outlook? As others have indicated
>SendObject doesn't work.
>
>It may not be possible to format the emails as you desire. The displaying of
>attachments is likely entirely at the mercy of the email client software.
>[/color]
I put the info into a report and that e-mailed as an attachment
with SendObject. | | | | re: E-Mail a formatted text attachment
Scott McDaniel wrote:[color=blue]
> How are you emailing this? Are you using SendObject? If so, as you've[/color]
seen,[color=blue]
> the formatting of SendObject leaves a lot to be desired. You can try[/color]
the[color=blue]
> other format types (html, rtf), but you'll likely find that they[/color]
don't[color=blue]
> render well either.
>
> One option is to forego the attachment and include your info in the[/color]
Body of[color=blue]
> the email. You can build it like this;
>
> Dim rst As DAO.REcordset
> Dim strBody As STring
>
> Set rst = CurrentDB.OpenRecordset("SQL statement to open the correct
> record")
>
> If Not (rst.EOF and rst.BOF) Then
> strBody = "Name: : " & rst("NameField") & vbCrLf & "Address: " &
> rst("AddressField") & vbcrlf & "City/State/Zip:" & rst("City") & " "[/color]
&[color=blue]
> rst("State") & ", " & rst("Zip")
> End IF
>
> DoCmd.SendObject , , , "user@user.com", , , "Subject Here", strBody,[/color]
True[color=blue]
>
> set rst = Nothing
>
> Or you can build a plaintext file and use other methods to attach it[/color]
.... or[color=blue]
> print your report to PDF and send that (can't do it with SendObject,[/color]
but[color=blue]
> there are other methods available).
>
> <brigitte@dreamafrica.co.za> wrote in message
> news:1111748219.155099.265440@l41g2000cwc.googlegr oups.com...[color=green]
> > Hi,
> >
> > I'm having trouble with a specific e-mail text format attachment[/color][/color]
....[color=blue][color=green]
> >
> > The requirement is for the attachment to be .txt type and in this
> > format:
> > Label=FieldValue
> > Label=FieldValue
> > Label=FieldValue
> >
> > Label=FieldValue
> > Label=FieldValue
> >
> > etc., etc.,
> >
> > The only way I could figure to accomplish this was to 1st do a[/color][/color]
report[color=blue][color=green]
> > in this format, but the problem I'm having is that as soon as I put[/color][/color]
the[color=blue][color=green]
> > controls too close together, the spacing between each row is not[/color][/color]
the[color=blue][color=green]
> > same - I need the each row to be directly under the other, with no[/color][/color]
line[color=blue][color=green]
> > spacing unless a space has been left on the report. The[/color][/color]
line-spacing[color=blue][color=green]
> > when viewing the report is fine, but as soon as it is e-mailed as[/color][/color]
an[color=blue][color=green]
> > attachment, the .txt attachment's line spacing is irregular - I[/color][/color]
would[color=blue][color=green]
> > really appreciate a solution to this problem. Many thanks
> >[/color][/color] | | | | re: E-Mail a formatted text attachment
Hi Scott,
Many thanks for your response ...
I am using SendObject to generate e-mail.
With reference to your last paragraph - "build a plaintext file" how do
you mean exactly & "use other methods to attach it" what would these
be?
Thank you
Scott McDaniel wrote:[color=blue]
> How are you emailing this? Are you using SendObject? If so, as you've[/color]
seen,[color=blue]
> the formatting of SendObject leaves a lot to be desired. You can try[/color]
the[color=blue]
> other format types (html, rtf), but you'll likely find that they[/color]
don't[color=blue]
> render well either.
>
> One option is to forego the attachment and include your info in the[/color]
Body of[color=blue]
> the email. You can build it like this;
>
> Dim rst As DAO.REcordset
> Dim strBody As STring
>
> Set rst = CurrentDB.OpenRecordset("SQL statement to open the correct
> record")
>
> If Not (rst.EOF and rst.BOF) Then
> strBody = "Name: : " & rst("NameField") & vbCrLf & "Address: " &
> rst("AddressField") & vbcrlf & "City/State/Zip:" & rst("City") & " "[/color]
&[color=blue]
> rst("State") & ", " & rst("Zip")
> End IF
>
> DoCmd.SendObject , , , "user@user.com", , , "Subject Here", strBody,[/color]
True[color=blue]
>
> set rst = Nothing
>
> Or you can build a plaintext file and use other methods to attach it[/color]
.... or[color=blue]
> print your report to PDF and send that (can't do it with SendObject,[/color]
but[color=blue]
> there are other methods available).
>
> <brigitte@dreamafrica.co.za> wrote in message
> news:1111748219.155099.265440@l41g2000cwc.googlegr oups.com...[color=green]
> > Hi,
> >
> > I'm having trouble with a specific e-mail text format attachment[/color][/color]
....[color=blue][color=green]
> >
> > The requirement is for the attachment to be .txt type and in this
> > format:
> > Label=FieldValue
> > Label=FieldValue
> > Label=FieldValue
> >
> > Label=FieldValue
> > Label=FieldValue
> >
> > etc., etc.,
> >
> > The only way I could figure to accomplish this was to 1st do a[/color][/color]
report[color=blue][color=green]
> > in this format, but the problem I'm having is that as soon as I put[/color][/color]
the[color=blue][color=green]
> > controls too close together, the spacing between each row is not[/color][/color]
the[color=blue][color=green]
> > same - I need the each row to be directly under the other, with no[/color][/color]
line[color=blue][color=green]
> > spacing unless a space has been left on the report. The[/color][/color]
line-spacing[color=blue][color=green]
> > when viewing the report is fine, but as soon as it is e-mailed as[/color][/color]
an[color=blue][color=green]
> > attachment, the .txt attachment's line spacing is irregular - I[/color][/color]
would[color=blue][color=green]
> > really appreciate a solution to this problem. Many thanks
> >[/color][/color] | | | | re: E-Mail a formatted text attachment
Hi Tony,
Many thanks for your response ...
The end-users are using different e-mail applications so the format
will have to be application non-specific. Is there any way to force the
format of an attachment regardless of the e-mail application used to
send?
Thank you |  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,382 network members.
|