emailing report as main body?

jackie77

Jackie
Local time
Today, 13:19
Joined
Jul 18, 2007
Messages
85
Hi all :)

I know there is a number of treads on this forum devoted to emailing reports etc as the main body of an email but they are all to in-depth and I can’t manage to simplify them to get them to work for me

What I basically want to do is
I have a report called: report_titan
I have a button on a form called: email_titan
I want to send it to: joe.blogg@whatever.com
and to
jane.blogg@whatever.com
subject line: customer statement

What I want to do is when I click the send button the report is sent as the main body of the email to the two email recipients, I can easily get the report to send as an attachment but not as part of the main body of the email as you may have guessed I’m new to VBA so any help would be great

Thanks

Jackie
 
2 Problems on this
1 you would have to have a lot of coding to make this work - and a lot of chr13 an chr 15(?) otherwise your report could end up looking iffy at beast
example if you want your report to look like

Dear Sir,
our information follows:-
blah bhal bhal

it could end up looking lile
Dear Sir ,
our information follows:-blah blah bhal

all on one long line
and next(2) its how it is recieved at the other end can make it look ugly


nowyou could do this in word and use words email capibailities to send

so you would end up with
access to word to email

or word email merge via Access would be a better option

However the access gurus here might have better views and process for this (I am just a bodger)

g
 
Hi there, thank you both for the replies, I have seen this link before but
I was not sure how to set it up for my purposes, two really stupid questions :o where should I place the code used in this example? I have placed it on the button and worked around with it but it is not working second, I have office 2007 does this make a difference as its now windows mail?

the code is:

Code:
Function exporthtml()

Dim strline, strHTML

 Dim OL As Outlook.Application
  Dim MyItem As Outlook.MailItem

  Set OL = New Outlook.Application
  Set MyItem = Outlook.Application.CreateItem(olMailItem)
  
  DoCmd.OutputTo acOutputReport, "report_titan", acFormatHTML,
"C:\myreport.html"
  
  Open "C:\myreport.html" For Input As 1
  Do While Not EOF(1)
    Input #1, strline
    strHTML = strHTML & strline
  Loop
  Close 1
  ' If OL2002 set the BodyFormat
  If Left(OL.Version, 2) = "10" Then
    MyItem.BodyFormat = olFormatHTML
  End If
  MyItem.HTMLBody = strHTML
  MyItem.Display

End Function

can anyone put me in the right direction ;)

thanks

Jackie
 
I suspect the code may not work in 2007 or 2003, but I'm no expert.
 
anyone have any other suggestions, I read a bit about screenshoot, would it be possible to take a screenshoot of report then paste this into the main body of the email?

Jackie
 
that won't work,
cos if your gonna do that you might as well do an attachment or rtf




I think that the word option is probably the best option and will involve a lot of messing about -

what you need is word, lay it out as you wish it to appear

then coding to fill in the holes and then coding to fill in to and cc
then coding to force access to open word (plenty of code examples of this -so this bit easy)

g
 
thanks gary I will have a look into this option

jackie
 
Hi there

I am useing access 2007 and it is built into the command button functions
so I simply created a button and selected the option to email report!

Sorry if this is not of much help to you, there are however some very good coded examples in this forum if you just carry out a search

regards

Jackie
 
Wow... Access 2007 huh? Look forward to using it in about 5 years. haha

Thanks for your help!!
 

Users who are viewing this thread

Back
Top Bottom