Outlook 2007 userform into body of template?

Joined
Mar 29, 2012
Messages
2
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top