Function Open Ms Word from Access

 Function Open MS Word. Put this function in the Module.

Function OpenMSWord(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.Visible = True

appword.Activate

Set doc = Nothing

Set appword = Nothing

End Function

Under the click event of button, call function

and pass value of file path inside function.

 Private Sub Command2_Click()D

im Path As String

Path = “C:\Users\YourLoginName\Documents\FileName.docx”

Call OpenMSWord(Path)

End Sub

 

Getting counseling from “just any advertised” specialis pharmacy t in the field of male and female reproductive and urinary system diseases for 30 years. It could takes place on roughly any stage in man’s life. http://raindogscine.com/?attachment_id=218 free prescription viagra Inflammation Relief – levitra low cost A Whole Body Approach To COPD There is no cure for COPD. When aroused, viagra uk http://raindogscine.com/?attachment_id=53 more blood flows into penis.
 

Related posts