title: Convert Access database to late binding to work with Access runtime
body: <p>I wrote code in Access database 2016 contains functions and macros, then I move this file to share with some users that don't have Access Application so, I install Access runtime it works well but I face many problems with reference libraries. 
  I decided to use late binding (by writing EarlyBinding = 0 in a database property of VBA editor)
  and uncheck all references except two (I can't uncheck) and covert  </p>
  
  <pre><code>Set appWord = New Word.Application
  </code></pre>
  
  <p>to</p>
  
  <pre><code>Set appWord = CreateObject(Word.Application)
  </code></pre>
  
  <p>note 1: I have a function to open Word document from Access form. 
  note 2: I convert the database extension from .accdb to .accdr 
  after I made changes in late binding and convert the previous statement no message error (for reference) appears but the function of open Word doesn't work.
  is there a tool like Access runtime for Word? so I can't open for this reason?
  below the code of this function:</p>
  
  <pre><code>Function fillWordForm()
  
  Dim appWord As Object
  Dim doc As Object
  Dim path As String
  Dim myID As String
  
  On Error Resume Next
  Error.Clear
  
  'Set appWord = CreateObject("word.application")
  Set appWord = CreateObject(Word.Application)
  If Err.Number &lt;&gt; 0 Then
  'Set appWord = New Word.Application
  'Set appWord = CreateObject(Word.Application)
  appWord.Visible = True
  End If
  
  'path = Application.CurrentProject.path &amp; "\H_F.docx"
  
  'path = "\\ubcdatacenter\Public\UBCIEDatabase\DOC\H_F.docx"
  path = "C:\Users\LENOVO\Desktop\UBC Database\H_F.docx"
  If FileExists(path) = False Then
  MsgBox "Template File Not Found", vbExclamation, "File Not Found"
  Else
  Set doc = appWord.Documents.Add(path, , True)
  myID = DLookup("ID", "Exports_imports_Table", "[ID] = " &amp; Me.ID)
  With doc
  .FormFields("BookID").Result = [ID]
  .FormFields("Book_BC_date").Result = Me.date_BC
  .FormFields("Book_AH_date").Result = Me.date_AH
  .FormFields("Book_AH_date").Result = Me.date_AH
  .FormFields("BookTopic").Result = Me.topic
  .FormFields("BookProjectName").Result = Me.projectName
  .FormFields("BookCompanyName").Result = Me.companyName
  .FormFields("BookContent").Range.Text = Me.content
  
  'Result = Me.content
  
  appWord.Visible = True
  appWord.Active
  End With
  Set doc = Nothing
  Set appWord = Nothing
  
  End If
  End Function
  </code></pre>
  
  <p>this code to ensure that file is excite</p>
  
  <pre><code>Function FileExists(ByVal strFile As String, Optional bFindFolders As Boolean) As Boolean
      'Purpose:   Return True if the file exists, even if it is hidden.
      'Arguments: strFile: File name to look for. Current directory searched if no path included.
      '           bFindFolders. If strFile is a folder, FileExists() returns False unless this argument is True.
      'Note:      Does not look inside subdirectories for the file.
      'Author:    Allen Browne. http://allenbrowne.com June, 2006.
      Dim lngAttributes As Long
  
      'Include read-only files, hidden files, system files.
      lngAttributes = (vbReadOnly Or vbHidden Or vbSystem)
  
      If bFindFolders Then
          lngAttributes = (lngAttributes Or vbDirectory) 'Include folders as well.
      Else
          'Strip any trailing slash, so Dir does not look inside the folder.
          Do While Right$(strFile, 1) = "\"
              strFile = Left$(strFile, Len(strFile) - 1)
          Loop
      End If
  
      'If Dir() returns something, the file exists.
      On Error Resume Next
      FileExists = (Len(Dir(strFile, lngAttributes)) &gt; 0)
  End Function
  </code></pre>
  
  <p>what should also convert to make all code late binding?
  <strong>Editing</strong>
  <strong>after Mathieu's changes</strong></p>
  
  <p>Function fillWordForm()</p>
  
  <pre><code>Dim appWord As Object
  Dim doc As Object
  Dim path As String
  Dim myID As String
  
  On Error Resume Next
  Error.Clear
  
  Set appWord = GetWordApp
  If appWord Is Nothing Then
      'can't get ahold of Word.Application... now what?
      MsgBox "No thing :(((((((((((((("
      'Exit Sub
  End If
  
  appWord.Visible = True '&lt;~ unconditional
  
  
  
  'Set appWord = CreateObject("word.application")
  'Set appWord = CreateObject(Word.Application)
  'If Err.Number &lt;&gt; 0 Then
  'Set appWord = New Word.Application
  'Set appWord = CreateObject(Word.Application)
  'appWord.Visible = True
  'End If
  
  'path = Application.CurrentProject.path &amp; "\H_F.docx"
  
  path = "\\ubcdatacenter\Public\UBCIEDatabase\DOC\H_F.docx"
  'path = "C:\Users\LENOVO\Desktop\UBC Database\H_F.docx"
  If FileExists(path) = False Then
  MsgBox "Template File Not Found", vbExclamation, "File Not Found"
  Else
  Set doc = appWord.Documents.Add(path, , True)
  myID = DLookup("ID", "Exports_imports_Table", "[ID] = " &amp; Me.ID)
  With doc
  .FormFields("BookID").Result = [ID]
  .FormFields("Book_BC_date").Result = Me.date_BC
  .FormFields("Book_AH_date").Result = Me.date_AH
  .FormFields("Book_AH_date").Result = Me.date_AH
  .FormFields("BookTopic").Result = Me.topic
  .FormFields("BookProjectName").Result = Me.projectName
  .FormFields("BookCompanyName").Result = Me.companyName
  .FormFields("BookContent").Range.Text = Me.content
  
  'Result = Me.content
  
  appWord.Visible = True
  appWord.Active
  End With
  Set doc = Nothing
  Set appWord = Nothing
  
  End If
  End Function
  </code></pre>
  
  <hr>
  
  <pre><code>Private Function GetWordApp() As Object
      On Error Resume Next
      Set GetWordApp = CreateObject("Word.Application")
  End Function
  </code></pre>