Hi,
I run the code detailed below on my PC under Windows 2000 with no problem.
I have tried to run it on two other users macines (running XP Professional) and keep getting an error – “Compile error: User-defined type not defined”. I thought that DataObject was a VBA type (search of the VBA help seems to confirm this) not a user type. Any suggestions?
Code follows:
Sub BranchMailCountsNew()
‘
‘ BranchMailCountsNew Macro
‘ Macro recorded 09/09/2002 by Raymond Anthony Basson
‘
Documents.Add Template:= _
“C:Documents and SettingsAdministratorMy DocumentsTemplatesWordBRANCH MAIL COUNTS .dot”, _
NewTemplate:=False, DocumentType:=0
Selection.Paste
Selection.GoTo What:=wdGoToTable, Which:=wdGoToFirst, Count:=1, Name:=””
Selection.SelectRow
Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdExtend
Selection.Rows.HeadingFormat = wdToggle
Selection.GoTo What:=wdGoToTable, Which:=wdGoToFirst, Count:=1, Name:=””
Selection.MoveRight Unit:=wdCell
Selection.MoveLeft Unit:=wdCell
Selection.Copy
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:=”SaveName”
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Dim MyData As DataObject THE ERROR HAPPENS HERE
] Set MyData = New DataObject
Any help would, as usual, be greatly appeciated