Download sample file at: www.iaccessworl... Open MS word file from MS Access using VBA Next: fill in word with data from Access • Fill in Word with data...
I'm looking for help to create a template. I have 5 different Word files that I'd like to be accessible through buttons in an Access database. The buttons should open specific pages in the Word files for editing and printing. Additionally, I'd like to keep a record of all my prints in a database. Is there anyone who can assist me with this?"
Hi,I have a Access database, where I have Excel files for Accounts. I can't make it right to open the Excel file from Access via Button and VBA. Can you help me here?
hello and thank you for this.. can i do this on a multiple buttons? and also can i do this on the sub forms? i try to do this on onother button but i shows blank MS word
Great tutorial! I'm learning so much from your videos. I do have a question though. Is there a way to create multiple buttons to open up different word docs on the same form. For example, I have a button to open a particular word doc but I want to create another button to open up a different word doc. Its looks like there is an argument between the two.
yes, you need to copy the code from the first buttong and paste it under another button then change the code to open different doc like file name, location and the field name on another doc.
austin72406 I got it to work. Thanks. I was getting an "ambiguous name" message when I did the copy and paste but all I had to do was rename the fillwordform to fillwordfowm1. I was also wondering how, if possible, can you do checkboxes the same way as your tutorial for text into word? I have the text importing into word but I have checkbox that I want to import as well.
Hallo Austin, very good video, i did all the code, adding the location of my doc file, but when i run it, it opens me on ly word, showing nothing, and all panels inactive. Can u assist me? Thanks!
I have done the code and it works well but the documents is in a blinking word icon on the task bar and then I click on it to display the document can I open the document straight away???
the document is already open by VBA code in Access, but it is not on your current application that you're using, so it shows as blinking word icon on the task bar. you just click that icon to view the word.
I'm getting this error message. I'm using Access 2007. Can you help with this. The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access as communicating with the OLE server of ActiveX Control.
Here is the code. i don't know if i missed something: Function openword(conPath As String) Dim appword As Word.Application Dim doc As Word.Document On Error Resume Next Error.Clear Set appword = GetObject(, "word.Application") If Error.Number o Then Set appword = New Word.Application appword.Visible = True End If Set doc = appword.Documents.Open(conPath, , True) appword.Activate Set doc = Nothing Set appword = Nothing End Function Private Sub Command22_Click() Dim mydoc As String mydoc = "C:\Documents and Settings\TOSHIBA\My Documents\Custice\kund avtal.docx" Call openword(mydoc) End Sub
is there a way to open a WORD doc in a form/subform? I would like to open a word doc from a form with dropdowns for document name, section name/number or hyperlink. the dicument could be searched by section or hyperlink. thanks.
you can create a table for list of document name and have field for the address of that word document. now when you select document from a drowload then will open the word document.
austin72406 I have a table of document names and a table of links (to bookmarks in the document) I can get the file to open separately in msword but i want it to open it in the form itself. thanks , i hope this clears it up
many reasons can happen. good thing at least it opens MS word. next step to make sure code is to open your word file at the correct location/file path.
austin72406 Option Compare Database Function openword(conPath As String) Dim appword As Word.Application Dim doc As Word.Document On Error Resume Next Error.Clear Set appword = GetObject(, "word.application") If Err.Number 0 Then Set appword = New Word.Application appword.Visible = True End If Set doc = appword.Documents.Open(conPath, , True) appword.Activate Set doc = Nothing Set appword = Nothing End Function Private Sub Command24_Click() Dim mydoc As String mydoc = "D:\2014 Inspections\To Be Sorted\Main Inspection Form.docx" Call openword(mydoc) End Sub
austin72406 Thats the code I have entered same from your video. I save it open form and when I click the button nothing happens at all. I don't know what step I missed I dont even get error message.
Thank you SO much! Extremely helpful and right on time for a "Non-Programmer" like myself!!!
8:55 is that somebody dying in the background?
Anyway great vids, helped me a lot with my Access job
I'm looking for help to create a template. I have 5 different Word files that I'd like to be accessible through buttons in an Access database. The buttons should open specific pages in the Word files for editing and printing. Additionally, I'd like to keep a record of all my prints in a database. Is there anyone who can assist me with this?"
Hi,I have a Access database, where I have Excel files for Accounts. I can't make it right to open the Excel file from Access via Button and VBA. Can you help me here?
hello and thank you for this.. can i do this on a multiple buttons? and also can i do this on the sub forms? i try to do this on onother button but i shows blank MS word
Great tutorial! I'm learning so much from your videos. I do have a question though. Is there a way to create multiple buttons to open up different word docs on the same form. For example, I have a button to open a particular word doc but I want to create another button to open up a different word doc. Its looks like there is an argument between the two.
yes, you need to copy the code from the first buttong and paste it under another button then change the code to open different doc like file name, location and the field name on another doc.
austin72406 I got it to work. Thanks. I was getting an "ambiguous name" message when I did the copy and paste but all I had to do was rename the fillwordform to fillwordfowm1. I was also wondering how, if possible, can you do checkboxes the same way as your tutorial for text into word? I have the text importing into word but I have checkbox that I want to import as well.
Is there a way to write an error handler to show a msgbox "document not found" if a blank word document pops up?
How to create new word document and and after editing save the same file as object in Ms access for future reference /record
How to make the home button, so i can copy document from ms word and save to ms access in home button, thank's before sir 🙏
Hello, Can you help me find a way so when i click the button on my form to open the ms word, it doesn't open in read-only mode, Thanks !
Hallo Austin, very good video, i did all the code, adding the location of my doc file, but when i run it, it opens me on ly word, showing nothing, and all panels inactive.
Can u assist me?
Thanks!
I have done the code and it works well but the documents is in a blinking word icon on the task bar and then I click on it to display the document can I open the document straight away???
the document is already open by VBA code in Access, but it is not on your current application that you're using, so it shows as blinking word icon on the task bar. you just click that icon to view the word.
Thank you
I successfully followed it but why is ms.word in read-only mode?
thanks it helped me a lot. but now i have variable paths.
so i cant type the path in vba. can you help me?
Anyone help me I’ve done it but the question is how to create another button and select link it to another fine in the same form
I'm getting this error message. I'm using Access 2007. Can you help with this.
The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access as communicating with the OLE server of ActiveX Control.
do you set the reference to MS Word?
yes i did.
Here is the code. i don't know if i missed something:
Function openword(conPath As String)
Dim appword As Word.Application
Dim doc As Word.Document
On Error Resume Next
Error.Clear
Set appword = GetObject(, "word.Application")
If Error.Number o Then
Set appword = New Word.Application
appword.Visible = True
End If
Set doc = appword.Documents.Open(conPath, , True)
appword.Activate
Set doc = Nothing
Set appword = Nothing
End Function
Private Sub Command22_Click()
Dim mydoc As String
mydoc = "C:\Documents and Settings\TOSHIBA\My Documents\Custice\kund avtal.docx"
Call openword(mydoc)
End Sub
My word file is connected with access (Mail Merge). With your code i open the word file but i cannot use mail Merge. Do you have any solution?
I'd love to hear an answer to this
is there a way to open a WORD doc in a form/subform? I would like to open a word doc from a form with dropdowns for document name, section name/number or hyperlink. the dicument could be searched by section or hyperlink. thanks.
you can create a table for list of document name and have field for the address of that word document. now when you select document from a drowload then will open the word document.
austin72406 I have a table of document names and a table of links (to bookmarks in the document) I can get the file to open separately in msword but i want it to open it in the form itself. thanks , i hope this clears it up
What about Excel? sir
Mine opens a new blank word doc any help? Please and thank you.
many reasons can happen. good thing at least it opens MS word. next step to make sure code is to open your word file at the correct location/file path.
+austin72406 how can we open any file that we upload in database .... not just one file like your case (your file : Query ....etc)
When I click the button the button does nothing. Can you assist?
can you upload your code here? I will take a look.
austin72406
Option Compare Database
Function openword(conPath As String)
Dim appword As Word.Application
Dim doc As Word.Document
On Error Resume Next
Error.Clear
Set appword = GetObject(, "word.application")
If Err.Number 0 Then
Set appword = New Word.Application
appword.Visible = True
End If
Set doc = appword.Documents.Open(conPath, , True)
appword.Activate
Set doc = Nothing
Set appword = Nothing
End Function
Private Sub Command24_Click()
Dim mydoc As String
mydoc = "D:\2014 Inspections\To Be Sorted\Main Inspection Form.docx"
Call openword(mydoc)
End Sub
austin72406
Thats the code I have entered same from your video. I save it open form and when I click the button nothing happens at all. I don't know what step I missed I dont even get error message.
I tested your code with my file location. It works. Maybe you need to do Compact and Repair file.