View Single Post
 
Old 03-08-2016, 02:03 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

To use the userform with content controls instead of bookmarks, you might replace:
Code:
      Call UpdateBookmark("Description", "Widget Type A")
      Call UpdateBookmark("Revision", "1.01")
      Call UpdateBookmark("Material", "PVC")
      Call UpdateBookmark("Job_No", "1234")
with:
Code:
      With ActiveDocument
        .SelectContentControlsByTitle("Description")(1).Range.Text = "Widget Type A"
        .SelectContentControlsByTitle("Revision")(1).Range.Text = "1.01"
        .SelectContentControlsByTitle("Material")(1).Range.Text = "PVC"
        .SelectContentControlsByTitle("Job_No")(1).Range.Text = "1234"
      End With
and so on, where the titles are as indicated.

The code you're thinking of using would require all the content to be used for 'StrDetails' to be added programmatically to each of the userform ListBox's entries and, when an item is selected, retrieved from there before it could be used to populate the content controls.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote