Wrox Programmer Forums
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 7th, 2012, 01:08 PM
Registered User
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Content Control

I know how to insert a content control into the active document. However I would like to insert a content control into another one that is tagged "SomeTag". there are multiple content controls with this tag that I need to insert another one into.

I am assuming that I have to find the tag like this:
Dim strTmp As String, i As Integer, txt As Range
With ActiveDocument.SelectContentControlsByTag("sometag")
  For i = 1 To .Count
    strTmp = strTmp & .Item(i).Range.Text
    Set txt = .Item(i).Range
    With txt
    .Text = "Some Text" & 'InsertMy2ndContentControl &" MoreText"
    End With
I am reaching I know but any help would be appreciated.

Last edited by antoniops; February 7th, 2012 at 02:07 PM..

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing content control GWts BOOK: Beginning ASP.NET 4 : in C# and VB 1 March 20th, 2011 07:53 AM
Adding content control to table's row rezarezash Word VBA 0 August 23rd, 2008 12:36 AM
Control IDs in content pages LMIILM BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 1 December 8th, 2007 06:30 AM
Trying to find control on content page webjedi ASP.NET 2.0 Professional 1 April 28th, 2006 06:20 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.