Solved

How to Send Data Reports as an attachment in Visual Basic

Posted on 2006-07-20
5
367 Views
Last Modified: 2010-04-29
Hi All

Is there a single simple command in VB that compares to SendObject in VBA?
I have to automatically send an email from my application. I have been
using the following in VBA:

DoCmd.SendObject acSendReport, ObjectName:=stDocNameA, outputformat:=acFormatRTF, To:=toText, Subject:=FileName

Plz help me, its urgent
Thanks!
0
Comment
Question by:toutam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Accepted Solution

by:
Dbergert earned 63 total points
ID: 17149151
Need to USE CDO and an attachment

http://www.mvps.org/access/modules/mdl0019.htm
0
 

Author Comment

by:toutam
ID: 17153437
Thanks for your help !

I was wondering is there any was thats more simple than that, like what we have in VBA
0
 
LVL 1

Assisted Solution

by:almondmitchell
almondmitchell earned 62 total points
ID: 17177515
Public Class Form1

      Dim App As Outlook._Application
      Dim Msg As Outlook._MailItem

private sub button1_click

      App = New Outlook.Application
      Msg = App.CreateItem(Outlook.OlItemType.olMailItem)

'*************** add attachment  and send ******************

      Msg.Attachments.Add("c:\source")
      msg.to="email address"
      msg.send()

end sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to increase the row limit in Jasper Server.
This is about my first experience with programming Arduino.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Starting up a Project

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question