Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2012, 10:41 AM
Royzer Royzer is offline How to get Outlook 2007 userform into template? Windows XP How to get Outlook 2007 userform into template? Office 2007
Novice
How to get Outlook 2007 userform into template?
 
Join Date: Mar 2012
Location: Tallahassee, FL
Posts: 2
Royzer is on a distinguished road
Default How to get Outlook 2007 userform into template?

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Outlook 2007 userform into template? How to link userform to another word document SaneMan Word VBA 5 10-14-2011 05:12 AM
Outlook 2007 Default Template kyklico Outlook 0 07-09-2011 05:01 PM
Outlook userform validation help aiwnjoo Outlook 0 12-08-2010 12:57 AM
Displaying data from spreadsheet in Userform darklide Excel 0 03-12-2010 05:42 AM
[Word 2003] Macro's and a UserForm xanuex Word VBA 0 10-19-2009 05:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft