Distributing Reports

  • Thread starter Thread starter Skully
  • Start date Start date
S

Skully

Hi,

To e-mail use the outlook object. You need to add a
reference to it in the VB window Tools|References to
expose the object to your project. Pick Microsoft Outlook
9.0 object library. To save the report to file you should
be able to use Microsoft Scripting Runtime (add a
reference again)

Here's some sample VB for the e-mail stuff

Dim olApp As Outlook.Application
Dim olNewMail As Outlook.MailItem
Set olApp = New Outlook.Application
Set olNewMail = olApp.CreateItem(olMailItem)
'Now set the properties of the email and send it
With olNewMail
..Subject = ""
..To = "(e-mail address removed)" 'If you set up a distributio list
in Access you could put its name here
..Send
'etc etc then close it
..Close (olSave)
End with
'Kill the objects in the exit sub
ExitSub:
Set olApp = Nothing
Set olNewMail = Nothing
Exit Sub

Hope this helps. Do you know how to change the height
property of a GroupHeader/GroupFooter in a report - it
seems to be read-only property????
 
Skully,

Thanks for your help. What kind of coding would I use,
though, to have the report run automatically down a list
of sales rep numbers? i.e. email and save the report for
Sales rep #1 then for #2, etc?

Thanks again.

Jamie
 
You can download our eval for our batch reporting module
it has some sample code for tackling a task like emailing a report
to 1000 sales reps where you run the same report for each rep.

I prefer using a third party email component rather than relying on
Outlook. I also prefer using PDF for good printable reports and
Excel usally makes the best way to share data the user can play with.

Ou code should help get you started whether you decide to pay the
fee to buy our product or decide to code it yourself.

HTH,
Mark
RPT Software
http://www.rptsoftware.com

PS: For example I bet I could build your solution in a few hours. Let me
know if
you need any help.
 
Back
Top