View Single Post
 
Old 12-30-2015, 05:53 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You can set text in content controls with a userform just as easily as you can bookmarks or anything else.

However if you want to keep patching up an old unruly document that is your business. Say you have three ask fields bookmarkd name, age and IQ.

Create a userform with three text fields txtName, txtAge and txtIQ and a command button. Use this as the cb click procedure:

Code:
Private Sub CommandButton1_Click()
Dim oRng As Range
Dim oBM As Bookmark
  With ActiveDocument
    Set oBM = .Bookmarks("Name")
    Set oRng = oBM.Range
    oBM.Range.Text = txtName
    .Bookmarks.Add "Name", oRng
    Set oBM = .Bookmarks("Age")
    Set oRng = oBM.Range
    oBM.Range.Text = txtAge
    .Bookmarks.Add "Age", oRng
    Set oBM = .Bookmarks("IQ")
    Set oRng = oBM.Range
    oBM.Range.Text = txtIQ
    .Bookmarks.Add "IQ", oRng
  End With
  Hide
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote