Solved

Simple .net form to open outlook and populate fields?

Posted on 2012-03-18
2
303 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
[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
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

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