Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2019, 05:05 AM
blanchetdb blanchetdb is offline Using a UserForm to fill blanks in a letter Windows 10 Using a UserForm to fill blanks in a letter Office 2010
Novice
Using a UserForm to fill blanks in a letter
 
Join Date: Apr 2019
Posts: 1
blanchetdb is on a distinguished road
Default Using a UserForm to fill blanks in a letter

Hi,



I am very much a rookie when it comes to Word but have experience with using VBA and UserForms in Excel.

I presently have a template letter that contains blanks and options for various paragraphs to choose from in order to create a final version of a letter.

Can I use the UserForm approach so that the individual complete the letter can enter the required information in boxes to populate the blanks on the template and use checkboxes to select the desired paragraphs to figure in the letter. They would then select "complete" form a command button and the letter would create itself?

If anyone could provide with an example of code that would get me started, advise if it is possible or even an alternate approach, it would be greatly appreciated.

thank you
Dan
Reply With Quote
  #2  
Old 04-05-2019, 06:16 AM
gmaxey gmaxey is offline Using a UserForm to fill blanks in a letter Windows 10 Using a UserForm to fill blanks in a letter Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

https://gregmaxey.com/word_tip_pages..._userform.html
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 04-05-2019, 07:06 AM
gmaxey gmaxey is offline Using a UserForm to fill blanks in a letter Windows 10 Using a UserForm to fill blanks in a letter Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

As for the checkbox (included specific paragraphs). That depends on the strategy you use. One is to just include everything in the template and then delete the pieces you don't want:


Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim bCheckTarget1 As Boolean 'Simulates a checkbox value
Dim oRng As Range
  bCheckTarget1 = False
  If Not bCheckTarget1 Then
    Set oRng = ActiveDocument.SelectContentControlsByTitle("Target1").Item(1).Range
    ActiveDocument.SelectContentControlsByTitle("Target1").Item(1).Delete True
    oRng.Paragraphs(1).Range.Delete
  End If
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply

Tags
template drop-down, userform, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a UserForm to fill blanks in a letter Form Filling, setting up a standard letter to pop up with prompts to fill in certain areas Joanne Bombardier Word 2 10-07-2018 05:49 PM
Using a UserForm to fill blanks in a letter How to draw a fill in the blanks ? kingston123 Word 2 09-21-2018 05:49 AM
Using a UserForm to fill blanks in a letter Help, Fill in the blank type form letter Bumbledor Word 4 02-06-2015 10:17 AM
Using a UserForm to fill blanks in a letter fill blanks in box keevitaja Word 1 05-23-2011 06:34 PM
using word/able to fill blanks w/o moving rest Rath Word 3 03-07-2009 08:46 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:52 PM.


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