N
Nithya
This is part of my code.
Private Sub Generate_Letter_Click()
Dim dbLocal As DAO.Database
Dim replaceCodes As DAO.Recordset
Dim strCurrAppDir As String
Dim strFinalDoc As String
Dim varReplaceWith As Variant
Dim wrdApp As Object
Dim wrdDoc As Object
On Error GoTo Err_Generate_Letter_Click
Set dbLocal = CurrentDb()
strCurrAppDir = Left$(dbLocal.Name, InStr
(dbLocal.Name, -"\ECMS old.mdb"))
On Error Resume Next
Kill strFinalDoc
On Error GoTo Err_Generate_Letter_Click
FileCopy strCurrAppDir & "\sample.doc", strFinalDoc
Set appWord = CreateObject("Word.Application")
Set wordDoc = appWord.Documents.Add(strFinalDoc)
appWord.Visible = True
Set replaceCodes = dbLocal.OpenRecordset
("StateReplaceCodes") --- Here I get the type
mismatch error ( I have also made the reference to DAO 3.6
and also removed the reference to ADO Object)
TIA,
Private Sub Generate_Letter_Click()
Dim dbLocal As DAO.Database
Dim replaceCodes As DAO.Recordset
Dim strCurrAppDir As String
Dim strFinalDoc As String
Dim varReplaceWith As Variant
Dim wrdApp As Object
Dim wrdDoc As Object
On Error GoTo Err_Generate_Letter_Click
Set dbLocal = CurrentDb()
strCurrAppDir = Left$(dbLocal.Name, InStr
(dbLocal.Name, -"\ECMS old.mdb"))
On Error Resume Next
Kill strFinalDoc
On Error GoTo Err_Generate_Letter_Click
FileCopy strCurrAppDir & "\sample.doc", strFinalDoc
Set appWord = CreateObject("Word.Application")
Set wordDoc = appWord.Documents.Add(strFinalDoc)
appWord.Visible = True
Set replaceCodes = dbLocal.OpenRecordset
("StateReplaceCodes") --- Here I get the type
mismatch error ( I have also made the reference to DAO 3.6
and also removed the reference to ADO Object)
TIA,