closing Word Document

hawkesms

Registered User.
Local time
Today, 09:46
Joined
Nov 14, 2005
Messages
12
Can't unlock Word after opening with Access

Hi

I am trying to close Word (i.e. closing Word manually) opened using Access but keep getting 'normal.dot' is locked and being used by another application (basically Access).

How can I 'unlock' Word to allow users to close it?

The code I am using to open the document is:

Sub OpenWordDoc(strDocName As String)
Dim objApp As Object

'Opens the document
Set objApp = CreateObject("Word.Basic")

objApp.FileOpen strDocName
objApp.AppShow
objApp.Quit

Set objApp = Nothing

End Sub


All help very much appreciated.

Mark
 
Last edited:
just use a hyperlink :)

Sub OpenWordDoc(strDocName As String)
Application.FollowHyperlink strDocName , , True
end sub

Hardly worth creating a sub for!

Peter
 
Bat17 said:
just use a hyperlink :)

Sub OpenWordDoc(strDocName As String)
Application.FollowHyperlink strDocName , , True
end sub

Hardly worth creating a sub for!

Peter

Thanks Peter!

Never done this before and was starting to hit my head against the wall! This works a treat!

Mark
:)
 

Users who are viewing this thread

Back
Top Bottom