![]() |
|
#12
|
||||
|
||||
|
Quote:
Code:
Private Sub CommandButton2_Click()
Dim oCC As ContentControl
Dim sVia As String, lPK As String, sTermPart As String, arr() As String
sVia = ComboVia.Text
lPK = textPK.value
Select Case sVia
Case Is = "A-68"
If lPK < 85 Then
sTermPart = "Castejon|Tudela"
ElseIf lPK < 99 Then
sTermPart = "Corella|Estella"
Else
sTermPart = "Fontellas|Tafalla"
End If
Case Is = "NA-3010"
If lPK < 25 Then
sTermPart = "Cortes|Tudela"
ElseIf lPK < 35 Then
sTermPart = "Ribaforada|Tafalla"
Else
sTermPart = "Novillas|Estella"
End If
End Select
If UBound(arr) > 0 Then
arr = Split(sTermPart, "|")
For Each oCC In ActiveDocument.ContentControls
Select Case oCC.Title
Case Is = "termino"
oCC.Range.Text = arr(0)
Case Is = "partido"
oCC.Range.Text = arr(1)
End Select
Next oCC
End If
lbl_Exit:
Set oCC = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Saving a word doc as a pdf with bookmarks | MimiCush | Word | 10 | 03-26-2018 01:51 PM |
Deleting only all bookmarks contents not the bookmarks
|
adilprodigy | Word VBA | 1 | 10-11-2017 01:31 PM |
Form updating Bookmarks - writes to the bookmarks multiple times
|
PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |
selecting ms word bookmarks using vba
|
dnc | Word VBA | 4 | 05-10-2013 04:58 PM |
| word 2007 bookmarks | Dawn | Word | 0 | 07-14-2009 01:00 PM |