Solved

Simple .net form to open outlook and populate fields?

Posted on 2012-03-18
2
296 Views
Last Modified: 2012-03-18
I'm trying to make a simple form in vb (using visual studio) where my user can enter an email address, attach document(s), and enter a name, then click submit and it opens the an outlook email to where she can preview the email and then click send...this is my start (below), but it doesn't populate.  If I use With and then automate the send, it does fine, but when i remove the send it doesn't populate.  What am I missing?


Private Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
        Dim Outl As Outlook.Application
        Outl = CreateObject("Outlook.Application")

        Dim olMail As Outlook.MailItem
        olMail = Outl.CreateItem(Outlook.OlItemType.olMailItem)

        olMail.To = "yes@ys.com"
        olMail.Subject = "About our meeting..."
        olMail.Body = _
             "Dear"

        If Outl IsNot Nothing Then
            Dim omsg As Object
            omsg = Outl.CreateItem(0) '=Outlook.OlItemType.olMailItem'
            'set message properties here...'
            omsg.Display(True) 'will display message to user
        End If

    End Sub
0
Comment
Question by:Kevin Smith
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37734956
Check code here (it says VB6 but the idea is same)

http://www.vbforums.com/showthread.php?t=402083
0
 

Author Closing Comment

by:Kevin Smith
ID: 37735026
Awesome, thanks!  Can you check out this question as well?  http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_27637561.html
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now