![]() |
#1
|
|||
|
|||
![]()
Hi all
I'd be grateful if someone could help me with a Word VBA query I have. I'm trying to write a code which automatically insert field references into a word document. You can do this manually by pressing Ctrl & F9 and then type the reference into the field. However, when I record myself doing this the macro only picks it up as plain text, not as a reference. Does anyone know how I would go about doing this via VBA, or if it's even possible. Many thanks Antony |
#2
|
||||
|
||||
![]()
Hi Antony,
Here's a simple demo of inserting a QUOTE field at the selection: Code:
Sub Demo() With Selection .Fields.Add Range:=.Range, Type:=wdFieldEmpty, _ PreserveFormatting:=False, Text:="QUOTE" & Chr(34) & "Text to display" & Chr(34) .Fields.Update End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]() Quote:
|
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Roscoe | Word | 5 | 06-01-2016 01:39 PM |
![]() |
LittleCrunch | Word | 1 | 10-28-2013 03:50 AM |
MACRO - Insert row based on Form Field Criteria | Elan05 | Word VBA | 5 | 04-16-2013 06:39 AM |
Formula to subtract one month from due date field in reminder field | ghumdinger | Outlook | 1 | 10-01-2011 12:09 AM |
![]() |
Markw | Word | 5 | 11-19-2009 08:29 AM |