![]() |
#1
|
|||
|
|||
![]()
Good morning,
I would like to insert a wdFieldIf or wdFieldExpression type field but I'm having a problem. When I write the text of the field (see below), the starting and ending brace are created and interpreted automatically and correctly by VBA, but the ones inside (around PAGE and NUMPAGES) are not , they are created as standard characters and are not interpreted. Here is my VBA code: ActiveDocument.Fields.Add Range:=Selection.Range, Type:=wdFieldIf, Text:="{PAGE} = {NUMPAGES} ""last page""", PreserveFormatting:=True How to do "Ctrl+F9" in VBA code to generate interpretable braces for PAGE and NUMPAGES? Cordially, David |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Distribute text in one cell across a range of cells (overcoming selection.range.cells.count bug) | slaycock | Word VBA | 0 | 02-18-2017 07:00 AM |
![]() |
PRA007 | Word VBA | 2 | 02-19-2016 12:52 AM |
![]() |
paik1002 | Word VBA | 1 | 12-17-2015 04:51 AM |
Selection or Range | Tommes93 | Word VBA | 1 | 04-10-2014 02:50 AM |