473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

need to send a vba form in e-mail bosy after filling it up

Hi,

Let me explain what all are my need. I am working on a macro in outlook with the help of vba. I created a form once user will fill up the form, i want to send it in body of email. i am able to send e-mail with the data(value of form), but i need the graphics in the e-mail body. like whatever is my form layout, the same should be shown in e-mail body with the value.

Need to send a form in E-mail body after filling it up.

Can anyone please help out me.

right now i am using below code. But it's not worth, i have to do a long coding in html for layout of e-mail body.
Expand|Select|Wrap|Line Numbers
  1. Private Sub sendbutton_Click()
  2. Dim OutlookApp As Object
  3.     Dim MItem As Object
  4.     Dim email_ As String
  5.     Dim subject_ As String
  6.     Dim body_ As String
  7.     Dim attach_ As String
  8.  
  9.     Set OutlookApp = CreateObject("Outlook.Application")
  10.     subject_ = "Shift Handover" & ShiftHandover.TextBox15.Value
  11.     body_ = "<html><Style>Body{background-color:#19478D;}h1{background-color:#E68A2E;Text-Align:center}</Style><body><h1>Data Center Shift Handover</h1></body></html>" & vbNewLine & "How are you doing today?" & vbNewLine & vbNewLine & "Have you voted yet?"
  12.  
  13.      'create Mail Item and send it
  14.     Set MItem = OutlookApp.CreateItem(0)
  15.  
  16.     'Application.DisplayAlerts = False
  17.     With MItem
  18.         .To = "ransingh.yadav@bsci.com"
  19.         .Subject = subject_
  20.         .BodyFormat = olFormatHTML
  21.         .HTMLBody = body_
  22.          '.Attachments.Add "C:\FolderName\Filename.txt"
  23.         .Send
  24.     End With
  25.     'Application.DisplayAlerts = True
  26.  
  27.  
  28.     Unload Me
  29. End Sub
  30.  
Dec 24 '13 #1
2 1279
Rabbit
12,516 Expert Mod 8TB
I don't see any images in your code.
Dec 24 '13 #2
zmbd
5,501 Expert Mod 4TB
rsyadavsoft41:

Something to think about while I ponder what you are attempting...
If you send an HTML formatted email to me, it wont work.
My company has enforced plaintext email, exchange strips the HTML code from all of our emails, in or out.

Next, for my all of my Office programs, VBA is restricted, allowed to run only by user grant, approved signed code, or via trusted location... none of which would ever happen for outlook.

This is about the only way you can do it:
http://office.microsoft.com/en-us/ou...001210610.aspx
Dec 24 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Nathaniel Maier | last post by:
Hi. How can I send form results to an email address based on what the user selects? e.g. not to the same address all the time, and not to all addresses, but to the one that the user selects. How...
1
by: StevenBarnes | last post by:
I need to have some .Net code be able to send Email using my ISP's SMTP server. I found some articles on how to use the MAIL FROM: and RCPT TO: commands that you can stream to a tcp connection on...
1
by: Jeff West | last post by:
Greetings all, I'm not a developer (not even close) but have been teaching myself Access lately and would like to ask the group for some help. I've recently created a employee contact database...
4
by: blu3g85 | last post by:
how to use asp.net page to send an email? ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World!...
2
by: phillipmcgough | last post by:
I need to know how I can have a form sent to an email that is in a URL. For example: If I have a site with a form that has First Name: Last Name: Email: Phone: in it, and a person goes to...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
1
by: chaitanya02 | last post by:
Hi All, Well- this question might have appeared several times on this forum- but would appreciate your reply on this: I have a asp page, where customers login with some username and the pwd,...
1
by: Malli mindwave | last post by:
Hi, I want to send form data to given email id, I'm using mailto:ur@mail.com, but it doesn't working it dirsctly goes to localSystem A/C i.e outlook.. <form name="form1" method="post"...
2
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
10
by: Big Moxy | last post by:
I want to redirect the user back to the home page after submitting their form inquiry and display a message on the home page. I tried this in my send mail (apply.php) file - $_SESSION == "Thank...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.