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
Solved

How to Send Data Reports as an attachment in Visual Basic

Posted on 2006-07-20
5
363 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb wildfly example 2 22
youtube blocking politics 4 55
incorrect syntax near the order by 10 41
BATCH to EXE Converter 2 35
This is an explanation of a simple data model to help parse a JSON feed
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

856 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