Hello everyone, very new to Access.
I am trying to create a button that will run a macro and this macro needs to open up a Word file and use bookmarks to copy and paste some of the data from the Access database (people's names, addresses etc) into the Word document. I am using the code below to open the Word document but it fails. The computer is trying to open it but eventually nothing happens and no errors occur either.
I did go into VBA and into References and I linked with the Word Object Library. I also need to say that in our organisation we are using Microsoft Teams for file storage so in the code below, the path is a link pasted from Teams. I believe that the path is accurate because the code doesn't produce any errors, the computer tries to open the file for a second or two and than it stops and nothing happens. Any advice please?...?
Code:
Dim wApp As Word.Application
Dim wDoc As Word.Document
Set wApp = New Word.Application
Set wDoc = wApp.Documents.Open("path/FileName.docx")