Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-06-2021, 03:47 AM
gmaxey gmaxey is offline Selecting Drop-Down Auto-Populates formatted paragraphs of text Windows 10 Selecting Drop-Down Auto-Populates formatted paragraphs of text Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
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
Selecting Drop-Down Auto-Populates formatted paragraphs of text Auto Populate Text On Dependent Drop Down Exit GregStewartPTC Word VBA 2 02-27-2017 05:37 AM
Auto Text Drop Down List AJohn403 Word 3 05-01-2015 05:00 AM
Selecting Drop-Down Auto-Populates formatted paragraphs of text Text auto formatted as date format Aikeedoh Excel 5 09-06-2013 02:38 AM
Selecting Drop-Down Auto-Populates formatted paragraphs of text Date auto-populates based on checkbox mcarter9000 Word VBA 5 12-23-2010 12:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft