You need an AutoClose macro. Just name a macro AutoClose and it should run - scope will depend on where you put it. If it's in a document it should only run when that document is closed. if it's in your Normal template it will run when most any document is closed.
Yes, that's a macro in Word. From it you can do (more or less) what you want. If you add the following to the ThisDocument code module (under Microsoft Word Objects in your document) it will run a VBA routine in an Access Database when you close your document:
Code:
Sub AutoClose()
Dim appAccess As Access.Application
Set appAccess = CreateObject("Access.Application")
With appAccess
.OpenCurrentDatabase "
Code:
D:\My Documents\db3.mdb
Code:
"
.Run "
Code:
myPublicSubInAccessDatabase
Code:
"
.CloseCurrentDatabase
.Quit
End With
Set appAccess = Nothing
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.