Hello All, I need urgent help pls! I am new to working with VBA + Word 2007.
I am currently working with Word 2007 template document. On the template, I created few text fields using Content Controls(i.e. rich text control) instead.
I labelled the controls as Name, Title etc.
I have also created a simple VBA Userform with text fields i.e. Name, Title.
Now, rather than entering text/data directly into the template document when it is loaded, I want to use the VBA userform to enter the data so that the data gets transferred to the text areas on the document when a command button is clicked.
This is the requirement from my place of work and i need help pls. I have tried numerous suggestions from msdn site, but to no avail. I'm always getting run time errors e.g. "run-time error 5941: the requested member of the collection does not exist"
Private Sub CommandButton1_Click()
ActiveDocument.ContentControls("Title").Range.Text = TextBox1.Text
End Sub
Any help or code would be greatly appreciated, thanks.