View Single Post
 
Old 01-24-2019, 11:06 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
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