p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Word VBA (http://p2p.wrox.com/word-vba-231/)
-   -   Content Control (http://p2p.wrox.com/word-vba/86578-content-control.html)

antoniops February 7th, 2012 12:08 PM

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.


All times are GMT -4. The time now is 09:52 AM.

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