View Single Post
 
Old 06-02-2018, 04:29 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

If you name your bookmarks with a logical processing manner in mind then yes.

Code:
Sub UpdateBookmarks()
Dim lngIndex As Long, lngPart As Long
Dim oRng As Range
Dim strName As String, strDisplay As String
Dim arrParts() As String
  With ActiveDocument
    For lngIndex = 1 To .Bookmarks.Count
      Set oRng = .Bookmarks(lngIndex).Range
      strName = .Bookmarks(lngIndex).Name
      arrParts = Split(strName, "_")
      If UBound(arrParts) > 0 Then
        'For processing bookmarks names using following convention: _
         A_Complany_Name, B_Company_Address, etc.
        strDisplay = vbNullString
        For lngPart = 1 To UBound(arrParts)
          strDisplay = strDisplay & " " & arrParts(lngPart)
        Next
        oRng.Text = InputBox("Please enter " & strDisplay)
      Else
        oRng.Text = InputBox("Please enter " & strName)
      End If
      .Bookmarks.Add strName, oRng
    Next
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote