PC Review


Reply
Thread Tools Rate Thread

Outlook 2007 userform into body of template?

 
 
New Member
Join Date: Mar 2012
Location: Tallahassee, FL
Posts: 2
 
      13th Apr 2012
Hi. I am really new to vba, and using forms controls and vba with Outlook, in particular.

I've created a single userform that has 3 check boxes in it. I just need those three boxes--not the entire userform window--to sit in the body of the email so the recipient can check the box that applies to their situation and reply to the email.

I'm using UserForm1.Show in the code that brings up the template I'd like to use, but it's just showing it in the box the three checkboxes were created in.
Here's the entire code I have. It's opening a template and inserting the current date, then I added the userform1.show command at the end. Please help me get the three checkboxes into the body of the email. Thanks!

Code:
Sub WIBWOverpaymentNotice()
Set newItem = Application.CreateItemFromTemplate("S:\AR and Recon\Overpayment templates\WIBW Overpayment Notice .oft")
newItem.Display
Set newItem = Nothing
    Dim objOL As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Dim objItem As Object
    Dim strStamp As String
    On Error Resume Next
    Set objOL = Application
    Set objItem = objOL.ActiveInspector.CurrentItem
    If Not objItem Is Nothing Then
        If objItem.BodyFormat = olFormatHTML Then
            Set objNS = objOL.Session
            strStamp = Format(Now, "Long Date")
            objItem.HTMLBody = Replace(objItem.HTMLBody, _
                               "datehere", _
                               strStamp)
        End If
    End If
    Set objOL = Nothing
    Set objNS = Nothing
    Set objItem = Nothing


UserForm1.Show

End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To reduce your body weight & slim your body Loss weight Windows Vista Installation 0 20th Jul 2007 06:57 PM
To reduce your body weight & slim your body Loss weight Microsoft Outlook BCM 0 20th Jul 2007 06:50 PM
How can I distinguish the email body is plain text or html body? epjames Microsoft Outlook VBA Programming 10 2nd Sep 2004 01:03 PM
attachments are in the body of email, not on line above the body seeker@chi.net.au Microsoft Outlook Discussion 2 5th Jul 2004 07:56 PM
msgs come w/body text in the body AND as a txt attachment? janel Microsoft Outlook 1 19th Dec 2003 06:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:07 PM.