473,467 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need VBA coding for sending msgs using .OFT as body

57 New Member
Hello evryone,

Happy Friday! I'm looking for a way to send mass emails using outlook email template (.oft) as body of the email since using information from the text box ruins the formatting.

Below is the code I'm working on.

Thank you.

Expand|Select|Wrap|Line Numbers
  1. Private Sub btn_send_Click()
  2.  
  3.     Dim olApp As Object
  4.     Dim objMail As Object
  5.     Dim Issue As String
  6.     strIssue = Me.txt_body
  7.  
  8.    On Error Resume Next 'Keep going if there is an error
  9.    Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open
  10.  
  11.    If Err Then 'Outlook is not open
  12.      Set olApp = CreateObject("Outlook.Application") 'Create a new instance
  13.    End If
  14.      'Create e-mail item
  15.      Set objMail = olApp.CreateItem(olMailItem)
  16.  
  17.   With objMail
  18.     .To = "XXXX@XXX.com"
  19.     .Subject = "Form issue"
  20.     .Body = strIssue & txt_sign
  21.     .send
  22.   End With
  23.  
  24.   MsgBox "Operation completed successfully"
  25.  
  26.  
  27. End Sub
I would prefer to click a button and upload a .oft template but a static location in the share drive is fine.

Thanks a lot for the help.
Feb 13 '15 #1
1 1378
aflores41
57 New Member
I would prefer to click a button and upload a .oft template but a static location in the share drive is fine.

Thanks a lot for the help.
Feb 13 '15 #2

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

Similar topics

1
by: Patrick Blackman | last post by:
Hi I need a good example using ms access with C#. I have to develop a multi user test application using access. Need some pointer on how to handle user conflicts etc. All examples I have seen use...
3
by: A | last post by:
Hi all! I would like to ask a question on sending emails... I have a web application that requires sending emails using email templates. The templates that I've made are separate HTML files...
6
by: lalit26011983 | last post by:
Can any1 help me... How to send emails using asp.net.. I m using windows 2000 server and visual studio 2003(.net framework 1.1) I m not getting any error while i m sending email using...
2
nirmalsingh
by: nirmalsingh | last post by:
hai everybody, just like we write html coding in c# using response.write("<label></label>"); could i write javascript? help me with sample coding plz.....
2
by: prasenjit2007 | last post by:
Hello, can u help me sending Email with attachments using the Class phpMailer. On the website I have a link to an html form in which I input the parameters with the names 1)from(textbox name)...
3
by: shansivamani | last post by:
using SMTP to send email. is there any settings need to be configured apart from Host name and Port, while sending emails using SMTPClient in .Net? when i try to send mail to ids which has only...
0
by: Bernhard Walle | last post by:
Hi, * cindy jones : Following (tested) snippet should help: ------------------ 8< ------------------------------ from smtplib import SMTP from email.mime.image import MIMEImage from...
0
by: trivedimca2005 | last post by:
I am using below code for sending Email using .net. Its not working on client machine. My server IP is:- 192.168.10.10 and also uses proxy and user-name and password for proxy settings are...
2
by: Ananthu | last post by:
I am developing an ASP.NET web page for sending sms using gsm modem. I have connected my phone using data cable to my PC. What are all the other requirements needed? I need to write vb.net...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.