Hi guys,
I Need Some Help
I use this code to fill a word document with records from a access form:
Code:
Option Compare Database
Private Sub Command14_Click()
Call fillwordform
End Sub
Function fillwordform()
Dim appword As Word.Application
Dim doc As Word.Document
Dim Path As String
On Error Resume Next
Error.Clear
Path = "C:\Users\Home\Desktop\Print.docx"
Set appword = GetObject(, "word.application")
If Err.Number <> 0 Then
Set appword = New Word.Application
app.Word.Visible = True
End If
Set doc = appword.Documents.Open(Path, , True)
With doc
.FormFields("Text1").Result = Me.Field1
.FormFields("Text2").Result = Me.Field2
.FormFields("Text3").Result = Me.Field3
End With
appword.Visible = True
appword.Activate
Set doc = Nothing
Set appword = Nothing
End Function
The project was made on my home pc using Office 2016 and works fine but when a try to run the code on my pc from work i get this error: "Your Microsoft Access database or project contains a missing or broken reference to the file 'MSWORD.OLB' version 8.7"
On pc from work I have word 2013 and access runtime 2013.