Hi Folks
I've been asked to debug some VBA code from a macro in a Word document that no longer works now we've moved to Office 2010. I'm told I need to convert the code to ADO. I'm unsure what this means and I'm a little bit out of my depth. Can anyone help me with this please? Here's the code:
Code:
Sub DutyOfCare2()
Dim Db As Database
Dim WkSpace As Workspace
Documents.Add Template:="cwtn.dot"
ActiveDocument.PageSetup.HeaderDistance = 0
On Error Resume Next
Application.StatusBar = "Opening Database"
Set WkSpace = CreateWorkspace("Contender", "", "", dbUseODBC)
Set Db = WkSpace.OpenDatabase("Contender", dbDriverComplete, False, "ODBC;DATABASE=/usr/username/v7/databases/live/username;...;...;DSN=Contender")
If BuildDutyOfCareReps(Db) Then
Dialogs(wdDialogFilePrint).Show
End If
Db.Close
Application.StatusBar = "Ready"
ActiveDocument.Saved = True
End Sub
Thanks
Remster