linking a word doc with access

mushmoom

Board Regular
Joined
May 2, 2003
Messages
84
i am trying to open a word doc from the user form but keep getting
variable not defined
my code are as fellow

Dim oApp As Object

Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Open head.doc


Exit_Command15_Click:
Exit Sub

Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click


please help
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Where are you getting the error?

Is it on this line
oApp.Open head.doc

Try changing it to

oApp.Open "head.doc"
 
Upvote 0
Try this

oApp.Documents.Open "head.doc"
 
Upvote 0
thanks i tried that and now i am getting
this file could not be found
trying one or more of the following
check the name or try other doc
 
Upvote 0
i was just thinking eventhough the doc file and ath access file are in the same folder do i still have to give the path to the word.doc
 
Upvote 0

Forum statistics

Threads
1,221,710
Messages
6,161,445
Members
451,706
Latest member
SMB1982

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top