Solved

Simple .net form to open outlook and populate fields?

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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