Here's the code:
Sub copyID()
'
' copyID Macro
' Macro recorded 11/15/2005 by kcaulfield
'
'Copies database ID to column
Dim otherDoc As Word.Document
Dim fixedDoc As Word.Document
Set otherDoc = ActiveDocument
For Each otherDoc In Documents
If Not otherDoc Is fixedDoc Then Exit For
Next
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Database ID:"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Copy
'Secondary document (2)
ChangeFileOpenDirectory "C:\Aim compensation\"
Set fixedDoc = Documents.Open(FileName:="""PMP Import.doc""",
ConfirmConversions:=False, _
ReadOnly:=True, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto)
fixedDoc.Activate
Selection.SelectColumn
Selection.Paste
End Sub
----------------I can't get past the code before I get an error about Object
Required.-----