Consulting

Results 1 to 3 of 3

Thread: Return Tag of selected Content Control

  1. #1

    Return Tag of selected Content Control

    Hey there,

    I'm trying to receive the tag of a content control.

    im using
    Selection.Information(wdInContentControl)
    to check if the cursor is currently in a content control. Now I have to find out, which tag is assigned to this selected content control.

    Any ideas, hints or solutions?

    Greetings

    DennyCrane

  2. #2
    Try the following
    Dim oCC As ContentControl
        Set oCC = Selection.Range.ParentContentControl
        If Not oCC Is Nothing Then
            MsgBox oCC.Tag
        Else
            MsgBox "The cursor is not in a content control"
        End If
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    Thank you, works fine.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •