473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Export to Email in Windows Application?

So instead of exporting to Excel like Ive seen before, I was wondering if anyone has ever exported a datagridview to Outlook in an email? Is this possible and if so does anyone have an VB code that could help put me on the right path for this?
Oct 20 '09 #1
1 1093
OuTCasT
374 256MB
THis is how i send a listbox items to outlook.
I'm sure its possible to alter and send a gridviews information.

Expand|Select|Wrap|Line Numbers
  1. Dim objOutlook, objMsg, objNameSpace, objFolder, strOutput, strSubject, StrTo, StrMsg
  2.         StrTo = Mail
  3.         Const olMailItem = 0
  4.  
  5.         'objMsg.To = StrTo
  6.         objOutlook = CreateObject("Outlook.application")
  7.         objNameSpace = objOutlook.GetNameSpace("MAPI")
  8.  
  9.         Dim strBuiler As New StringBuilder
  10.         Dim strFinal As String
  11.  
  12.         Dim i As Integer
  13.         Dim m As String
  14.         For i = 0 To ListBox2.Items.Count - 1
  15.  
  16.             m = ListBox2.Items(i)
  17.             strBuiler.Append(m)
  18.             strBuiler.Append(";")
  19.         Next
  20.         strFinal = strBuiler.ToString
  21.  
  22.         objMsg = objOutlook.CreateItem(olMailItem)
  23.         objMsg.bcc = strFinal
  24.         objMsg.Display()
  25.         objFolder = Nothing
  26.         objNameSpace = Nothing
  27.         objOutlook = Nothing
  28.         objMsg = Nothing
Nov 9 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Mike MacSween | last post by:
My client has an MS Access database application on her local machine. I have full access to that in terms of changing the design. I've got a simple PHP/MySql application on shared hosting, so no...
1
by: frankvfox | last post by:
I need a code sample using VB ASP.Net 2003 which exports a tab delimited text file resident on the server into an Excel spreadsheet which will be saved through the browser to the client's local...
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
3
by: Jorge Cecílio | last post by:
Hi! I would like to export some MS-Access reports output to pdf. However, the only possibility offered by Access (afaik) for me to export formatted output is snp (snapshot) (I use MS-Office...
0
by: Frank M | last post by:
I am writing an application with a dataload class. The development is done in Windows XP, and on the development Pc I can do a dataload and export without any problems if I use...
11
by: Dr. Zharkov | last post by:
We want to export myArrayVB (2000, 2) of VB .NET 2003 in myArrayVó of VC++ .NET 2003 on scheme "component - client". But there is an error. For development of a component in VB .NET 2003 we...
13
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"...
3
by: Amirallia | last post by:
Hello Here is my code to export a datagrid to Excel, it's work but the no ASCII caracter are not correctly exported (for example : caracter "é" ) Response.Clear() Response.Buffer = True ...
1
by: tong_su | last post by:
Hi, I am using udb version 8 fixpack 12 installed on Linux. I need to move a schema from one db to another. All tables in the target and source schemas are created using 'CCSID UNICODE'. I used...
2
by: TG | last post by:
Hi! I am trying to export only the visible columns from a datagridview in my windows form in VB 2008. Should't it be no comma after the first row where the headers are? Also should...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.