Hi Guys

I get an error each time I try to execute the following code. It is a Compile Error: User-defined type not defined.
This is the only module within this workbook.

Option Explicit
Const FilePath As String = "C:\Documents and Settings\DAJO\My Documents\MD-CPH\ExcelSampleFiles\VBABMcopy\d5.docx"

Dim wd As New Word.Application
Dim PersonCell As Range
Sub CreateWordDocuments()

Dim doc As Word.Document
wd.Visible = True
Dim PersonRange As Range
'create a reference to all the people
Range("A1").Select
Set PersonRange = Range( _
ActiveCell, _
ActiveCell.End(xlDown))

For Each PersonCell In PersonRange

Set doc = wd.Documents.Open(FilePath & "Word form.docx")
'go to each bookmark and type in details
CopyCell "FirstName", 1
CopyCell "LastName", 2
CopyCell "Company", 3
'save and close this document
doc.SaveAs2 FilePath & "person " & PersonCell.Value & ".docx"
doc.Close
Next PersonCell
wd.Quit
MsgBox "Created files in " & FilePath & "!"
End Sub
Sub CopyCell(BookMarkName As String, ColumnOffset As Integer)
'copy each cell to relevant Word bookmark
wd.Selection.GoTo What:=wdGoToBookmark, Name:=BookMarkName
wd.Selection.TypeText PersonCell.Offset(0, ColumnOffset).Value
End Sub
What am I doing wrong?

Best regards
Danny