! Call Procedures in Word !

  • Thread starter Thread starter Wembly
  • Start date Start date
W

Wembly

Hi,

Is it possible to call procedures in Word from Access?

E.g. Word doc has a public procedure that performs letter
merge. Can I call this procedure from an Access cmdButton,
rather than getting the user to click on a button in Word
to activate the code?

I already have code that opens the doc template, and I
want to append the above code after the code that opens
the DOT.

Thanks

Wembly
 
Is it possible to call procedures in Word from Access?

Use Application.Run method.

in doc2.doc

Public Sub Foo()
Msgbox "In Foo"
End Sub

In Access,

Dim w As Word.Application

Set w = New Word.Application
With w
.Visible = True
.Documents.Open CurrentProject.Path & "\Doc2.doc"
Call .Application.Run("Foo")
End With

-- Dev
 
Back
Top