Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Word Document 3

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
I have a log on page with the textbox and four controls, one of the controls is a Help button. When clicking on this button will ask the user if they would like to view a manual. this manual is a word document. Can Access 2000 do this? Thanks!!!
 
Try this
Grant
'------------


Option Compare Database
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1

Public Sub OpenApp()
ShellExecute Me.hwnd, vbNullString, "C:\temp\grantdonovancv2.doc", vbNullString, "C:\", SW_SHOWNORMAL
End Sub

 
Or if you want to use Word try this:
------------

dim objWord as Word.Application

Set objWord = CreateObject("Word.Application")

objWord.Documents.Open("your document path")
objWord.Visible = True

set objWord = nothing
 
Oh and by the way, to get it to ask the person first, do this:

-----

Dim objWord As Word.Application

If MsgBox("Would you like to view the manual", vbYesNo) = vbYes Then
Set objWord = CreateObject("Word.Application")

objWord.Documents.Open ("your document path")
objWord.Visible = True

End If

Set objWord = Nothing
 
LeanneGodney,

this is what I did:
Private Sub Command26_Click()
Dim objWord As Word.Application

[tt]If MsgBox("Would you like to view the HR Help Desk Manual, if however you are experiencing technical difficulties please contact Jeanette Stuart", vbYesNo) = vbYes Then
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open ("K:\HelpDesk\Help_desk_Document.doc")
objWord.Visible = True

End If

Set objWord = Nothing[/tt]
But it doesn't work, I mean it doesn't even ask the question. Any idea why????

End Sub
 
Use:

Dim objWord As Object
Set objWord = CreateObject("Word.Application")

If MsgBox("Would you like to view the HR Help Desk Manual, if however you are experiencing technical difficulties please contact Jeanette Stuart", vbYesNo) = vbYes Then
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open ("C:\My Documents\hoze1.doc")
objWord.Visible = True

End If

Set objWord = Nothing
 
Check out this thread: thread702-242141

May assist you a little bit.

HTH

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top