Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 7th, 2012, 01:08 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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:
Code:
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
  Next
I am reaching I know but any help would be appreciated.

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:27 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.