Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 01-24-2019, 11:06 PM
Guessed's Avatar
Guessed Guessed is offline When check box is selected, need text to be written on bookmark Windows 10 When check box is selected, need text to be written on bookmark Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Graham is correct about the bookmark position not 'including' the text so you couldn't revisit the dialog multiple times. To resolve this on my previous code, the function should be amended to...
Code:
Function PopulateBM(aCtl As Control)
  Dim sBkmk As String, sText As String, aRng As Range
  sBkmk = aCtl.Tag
  sText = aCtl.ControlTipText
  With ActiveDocument
    If .Bookmarks.Exists(sBkmk) Then
      Set aRng = .Bookmarks(sBkmk).Range
      If aCtl Then
        aRng.Text = sText
      Else
        aRng.Text = ""
      End If
      aRng.Bookmarks.Add sBkmk
    End If
  End With
End Function
You could then query the values in those bookmarks to prefill the status of both settings as part of the UserForm_Initialize macro.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any efficient way to lock text that’s always written in a certain format? Gilvv Word 25 11-25-2018 04:52 PM
Macro to insert different sets of text at bookmark depending on sequence of selected check boxes chipper09 Word VBA 0 06-21-2018 01:49 PM
When check box is selected, need text to be written on bookmark 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
When check box is selected, need text to be written on bookmark Getting mult resps. selected in listbox to concatenate & paste at a bookmark in Word marksm33 Word VBA 3 01-15-2015 05:59 PM
Animation: text appears as if written by pen ionas.iona PowerPoint 0 03-31-2011 05:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:00 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