Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-30-2015, 05:53 PM
gmaxey gmaxey is offline Userform without inserting Bookmark text Windows 7 32bit Userform without inserting Bookmark text Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
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
  #2  
Old 12-31-2015, 09:20 AM
mktate mktate is offline Userform without inserting Bookmark text Windows 10 Userform without inserting Bookmark text Office 2010 64bit
Novice
Userform without inserting Bookmark text
 
Join Date: Dec 2015
Posts: 26
mktate is on a distinguished road
Default

Thanks, Greg. I really appreciate the Code to get a quick fix in place while we decide on whether I will be "unleashed" to do a more comprehensive overhaul. I used your site to get the userform set up, so thanks for all of that great information, as well.
Reply With Quote
Reply

Tags
bookmark, if fields, userform



Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform without inserting Bookmark text Bookmark not replaced when inserting but to lower right corner of image newbieX Word VBA 6 11-20-2015 02:03 PM
Send Userform Text to Bookmark tddfs Word VBA 5 07-30-2015 05:55 PM
Userform without inserting Bookmark text Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word marksm33 Word VBA 3 01-15-2015 07:55 PM
Userform without inserting Bookmark text Word 2003 - IncludeText Does Not Include Bookmark Text if in a Form Text Control skarden Word 1 12-12-2011 10:39 PM
Userform without inserting Bookmark text delete all bookmark text hklein Word VBA 4 08-10-2011 04:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:17 AM.


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