Results 1 to 5 of 5
  1. #1
    ricanos is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    4

    missing or broken reference to the file 'MSWORD.OLB' version 8.7

    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.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    each pc is different. You have to go into vbe, Tools, References, and put the WORD version that that PC does have.

  3. #3
    ricanos is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    4
    Quote Originally Posted by ranman256 View Post
    each pc is different. You have to go into vbe, Tools, References, and put the WORD version that that PC does have.
    Thanks for you replay. I have one question. I must put the word version in my home PC for word version in work PC?

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    your home pc may have 1 version, so it will be checked.
    the work pc may have a different one,
    but as long as its checked in references, it will run.

  5. #5
    ricanos is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    4
    Quote Originally Posted by ranman256 View Post
    your home pc may have 1 version, so it will be checked.
    the work pc may have a different one,
    but as long as its checked in references, it will run.
    Thanks to your replay, now it works, unchecked the missing version of word object library and I checked the available object library for that version of word.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Missing or Broken Reference
    By MaineLady in forum Access
    Replies: 4
    Last Post: 12-19-2014, 08:06 PM
  2. Replies: 1
    Last Post: 06-07-2013, 09:32 AM
  3. Broken link missing reference
    By Cran29 in forum Access
    Replies: 1
    Last Post: 04-25-2013, 02:03 PM
  4. Broken reference
    By NOTLguy in forum Programming
    Replies: 5
    Last Post: 11-10-2012, 08:26 AM
  5. Replies: 1
    Last Post: 06-23-2011, 07:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums