Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2019, 08:35 PM
gmayor's Avatar
gmayor gmayor is offline VBA to Populate text content controls in word from excel Windows 10 VBA to Populate text content controls in word from excel Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You can loop through all the controls and apply the appropriate value from the worksheet to the titled control e.g. as follows. You are still going to have to associate 30 titles with the 30 Excel cells

Code:
Dim oCC As ContentControl
    For Each oCC In ActiveDocument.ContentControls
        Select Case oCC.TITLE
            Case "title of control 1"
                oCC.Range.Text = whatever
            Case "title of control 2"
                oCC.Range.Text = whatever
            Case "title of control 3"
                oCC.Range.Text = whatever
                'etc
        End Select
    Next oCC

__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #2  
Old 08-05-2019, 07:11 AM
lmoir87 lmoir87 is offline VBA to Populate text content controls in word from excel Windows 7 64bit VBA to Populate text content controls in word from excel Office 2010 64bit
Novice
VBA to Populate text content controls in word from excel
 
Join Date: Jul 2014
Posts: 7
lmoir87 is on a distinguished road
Default

Thank you. This works great.
Reply With Quote
  #3  
Old 10-02-2020, 09:36 AM
rtodd.larsen rtodd.larsen is offline VBA to Populate text content controls in word from excel Windows 10 VBA to Populate text content controls in word from excel Office 2016
Novice
 
Join Date: Oct 2020
Posts: 1
rtodd.larsen is on a distinguished road
Default

Gmayor,

You posted a way to insert text into a rich content control. Is there a way to insert an image of an Excel table into a rich content control. I can't figure out the how I would need to change what you indicated for text for an image. I would really appreciate the help.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to Populate text content controls in word from excel Content Controls for large quantities of text tonia8675309 Word 5 06-08-2018 04:42 PM
VBA to Populate text content controls in word from excel Populate Content Control Dropdowns from Excel Deirdre Kelly Word VBA 23 09-07-2017 02:51 PM
VBA to Populate text content controls in word from excel Rich text/Plain text Content Controls in Template michael.fisher5 Word 9 11-19-2014 06:36 AM
VBA to Populate text content controls in word from excel Moving between Rich text content controls Sammie0Sue Word 4 03-12-2014 01:43 AM
VBA to Populate text content controls in word from excel Rich Text Content Controls: Formatting? tinfanide Word VBA 8 03-04-2013 04:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:18 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