![]() |
#3
|
|||
|
|||
![]()
Graham,
Why the loop? Code:
Sub AutoTextToCC(strCCName As String, oTemplate As Template, strAutotext As String) 'Graham Mayor - https://www.gmayor.com - Last updated - 10 Apr 2019 'strCCName is the ContentControl title 'oTemplate is the template with the autotext entry 'strAutotext is the name of the autotext entry Dim oCC As ContentControl On Error GoTo lbl_Exit Set oCC = ActiveDocument.SelectContentControlsByTitle(strCCName).Item(1) oCC.LockContentControl = True oTemplate.AutoTextEntries(strAutotext).Insert Where:=oCC.Range, RichText:=True lbl_Exit: Exit Sub End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word form that auto-populates (from Excel sheet) other content controls based on one,manually filled | spinn2046@gmail.com | Word VBA | 17 | 09-15-2020 04:13 PM |
![]() |
GregStewartPTC | Word VBA | 2 | 02-27-2017 05:37 AM |
Auto Text Drop Down List | AJohn403 | Word | 3 | 05-01-2015 05:00 AM |
![]() |
Aikeedoh | Excel | 5 | 09-06-2013 02:38 AM |
![]() |
mcarter9000 | Word VBA | 5 | 12-23-2010 12:39 PM |