dmarie,
I'm over my head all the time, but isn't it more fun in the deep end?
Document Properties (e.g., title, subject, comments, etc.) are stored in one of three built-in customXMLParts in a document. So, if you want you can find text and replace it with a content control and then bind that CC to the customXMLpart data node:
PHP Code:
Option Explicit
Sub ReplaceWithConentControlBoundToABuiltInDocProperty()
Dim oRng As Word.Range
Dim strFind() As String
Dim strInput As String
Dim i As Long
Dim oCC As ContentControl
strFind() = Split("student|your name", "|")
strInput = InputBox("Enter the replacement name:", "Input")
For i = 0 To UBound(strFind)
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = strFind(i)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
While .Execute
Set oCC = ActiveDocument.ContentControls.Add(wdContentControlText, oRng)
With oCC
'High jack the "Comments" document property.
.XMLMapping.SetMapping "ns1:coreProperties[1]/ns0:description[1]", , ActiveDocument.CustomXMLParts(1)
.Range.Text = strInput
.Title = "Name"
End With
Wend
End With
Next
End Sub
Sub ScratchMacro()
'This tells you some of the other node names and XPath
Dim oCXNOde As CustomXMLNode
Dim oCXNodes As CustomXMLNodes
Set oCXNodes = ActiveDocument.CustomXMLParts(1).SelectNodes("//*")
For Each oCXNOde In oCXNodes
Debug.Print oCXNOde.BaseName & " " & oCXNOde.XPath
Next
End Sub