Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
| Search | Today's Posts | Mark Forums Read
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2008, 03:29 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default [Resolved] [2005] Call Outlook in vb application

Anyone has some better code examples on how to open outlook from a vb application (I guess outlook.exe) and pass in an attachment? This is the code I have. Not sure if this is a good solution or not. Now I need to pass an attachment



Code:
Private Sub Email_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Email.Click

        Dim dblRetVal As Double
        Try
            dblRetVal = Shell("C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE", vbMaximizedFocus)
        Catch ex As Exception
            ErrorString = ex.ToString
            ConnectionError = True
            MsgBox("An error has been encountered trying to access Outlook " + vbCrLf + ErrorString)
        End Try
End Sub
 
Old February 12th, 2008, 04:58 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Found that this will work once you have a file name (export of CrystalReportViwer itsself will not work):

Shell("C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE" + "/a" + "File Name")





Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] Open Outlook application snufse .NET Framework 2.0 6 October 26th, 2008 10:53 PM
[Resolved] Call JScript tootip function snufse ASP.NET 2.0 Basics 11 August 22nd, 2008 11:33 AM
VB 2005 Application vs. Access Database dirtdog22 Visual Basic 2005 Basics 1 April 19th, 2008 08:27 AM
[Resolved] [2005] Call Outlook with attachment snufse .NET Framework 2.0 4 February 12th, 2008 09:59 AM
Tutor needed for VB 2005 application edx VB How-To 9 May 13th, 2007 04:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.