![]() |
#1
|
|||
|
|||
![]()
Hello word world,
just want to create a form which a user can enter a few frequently used terms (like cross-references/bookmarks). These terms will get entered throughout a document. It's easier in example: The Document describes a design which has slightly different parameters. In the Form, a line will say "Enter the number of wells". They enter "five", and the word "five" is put in all the predetermined slots throughout the document template. Like the sentence "this design has [five] wells". I am sure it's easy, I just can't find a guide to creating this type of form using google. |
#2
|
||||
|
||||
![]()
Would a macro work? If you already have a document template with those predetermined slots bookmarked, you could write a macro that prompts the user to enter values (for # of wells, etc, etc) and then populate the area of the document template marked by the bookmarks with the values entered.
|
#3
|
|||
|
|||
![]()
Very likely, but I'm not sure I have the programming prowess to do it yet.
I've been looking into Templates, AutoText, and Smart Documents as possible solutions but I know nothing about those features. In a nutshell: I have a 'boilerplate template' with a bunch of 'variable' slots that I want linked to one Form. I'm just trying to clearly define what I'm looking for here. JPB103, I think you understand based on your response. |
#4
|
||||
|
||||
![]()
So if you put a bookmark at a location where you want to put the text the user has entered, you could do something like this:
Code:
Dim BMRange As Range Dim pInput As String 'Prompt user for input' pInput = InputBox("Enter the number of wells." _ , "Populate Template") 'Error handler for user cancel' If pFindTxt = "" Then MsgBox "Cancelled by User" Exit Sub End If 'Identify current Bookmark range and insert text Set BMRange = ActiveDocument.Bookmarks("WellBookmark").Range BMRange.Text = pInput 'Re-insert the bookmark ActiveDocument.Bookmarks.Add "WellBookmark", BMRange |
#5
|
|||
|
|||
![]()
I see where this is going, I'll play with it. Thanks!
|
#6
|
|||
|
|||
![]()
Hmm i can't seem to get it to work, is there a method were I can set up an input form, and the output would be my document with all the variable terms replaced?
|
#7
|
||||
|
||||
![]()
Not that I know of off hand. I've had plenty of programming experience but I'm fairly new to composing macros. You might want to look into (google) VBA code for creating simple forms. Out of curiosity, what part of the macro above did not work? Did the input box appear to prompt the user?
|
#8
|
|||
|
|||
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
duckman | Word | 3 | 03-04-2014 10:12 AM |
Build a document from a set of standard paragraphs by using a tick list to select tho | pete knight | Word | 9 | 11-13-2013 02:05 AM |
Build a form with tables, first time | Jarubell | Word | 0 | 08-25-2012 07:09 PM |
![]() |
selvamariappan | Excel Programming | 1 | 12-12-2011 03:11 AM |
![]() |
gsj224 | Word VBA | 3 | 07-31-2011 09:26 AM |