Solved

Simple .net form to open outlook and populate fields?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you don't know how to downgrade, my instructions below should be helpful.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
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…

763 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