SOLVED-Word 2007 VBA: find control contect by a tag and enter text

  • Hello!
    I hope someone can take a look at my examples and give me some idea about what I'm doing wrong...or if it's even possible to do what I want:) Please see the attached file. It's a short example of the document I'm using.

    forum.ozgrid.com/index.php?attachment/35476/

    Problem: I have a macro (below), which doesn't work, since after restricting the document it "turns off" find function. I need help with changing my macro (the part in red color below) find fucntion from findind a word to finding a form tag and enterting the text based on what's entered in a pop up box.

    So, let's say the tag for the first form is businessname, then macro should have to something like

    Code
    Dim objCC As ContentControl    
    Dim myTag As String
        myTag = "businessname"
    'following by the part I don't know:)





    So i need the macro to find that tag and than edit that text form based on the info entered in the InputBox. Does it make sence?

    Note about the attachment: I wasn't able to attach the document in docx format, so I changed it to doc, which removed editable fields aka content controls


  • Re: SOLVED-Word 2007 VBA: find control contect by a tag and enter text


    I solved my own question. See example of the code below. This thread can be closed:)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!