Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 05-15-2014, 11:08 AM
jpb103's Avatar
jpb103 jpb103 is offline Create a Form to Build a Document Windows 7 64bit Create a Form to Build a Document Office 2007
Advanced Beginner
 
Join Date: May 2014
Location: Thunder Bay, Ontario
Posts: 58
jpb103 is on a distinguished road
Default

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
Where "WellBookmark" is the name of the bookmark where you wish to place the text. I haven't tested it though, so you might want to try using it on a copy first. Hopefully this helps, at the very least it's a starting point for you to start messing around with macros. Good Luck!
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a Form to Build a Document One document build from subfiles 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
Create a Form to Build a Document How to create an Excel add in that will automatically build tables from data selvamariappan Excel Programming 1 12-12-2011 03:11 AM
Create a Form to Build a Document Create Table Form from Word Document gsj224 Word VBA 3 07-31-2011 09:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:17 PM.


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