![]() |
|
|
Thread Tools | Display Modes |
#2
|
||||
|
||||
![]()
As we have no idea how your document is laid out - the expressions
If 1 "E1 " to be listed at the front of the document under condition rating 1 heading If 2 "E1 " to be listed at the front of the document under condition rating 2 heading If 3 "E1 " to be listed at the front of the document under condition rating 3 heading and also to be listed under the rear urgent section of the document. If NI "E1 " to be listed at the front of the document under not inspected heading are meaningless. It is also difficult to see the point of the building block gallery. A listbox control would be clearer, however the syntax you are looking for is as follows. Replace the message boxes with the appropriate actions Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Select Case ContentControl.Range.Text Case "1" MsgBox "1 selected" Case "2" MsgBox "2 selected" Case "3" MsgBox "3 selected" Case "NI" MsgBox "NI selected" End Select End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Word - Building Block (AutoText) - Array - Replace Text with Specific Building Blocks | jc491 | Word VBA | 7 | 01-03-2016 10:34 PM |
How-to: Add a quickpart, field or Building Block Gallery Content Control based on a UserForm | HighSierra | Word VBA | 0 | 05-06-2015 08:20 PM |
Using Building Block Gallery Content function on a form with restricted editing | wes228 | Word VBA | 1 | 08-28-2014 08:14 AM |
how to make building block content control determine bb to display elsewhere | jamles12 | Word VBA | 5 | 11-16-2013 11:38 AM |
Building blocks show correctly in dropdown, but wrong building block populates in doc | wordgirl123 | Word | 0 | 10-03-2013 08:30 AM |