View Single Post
  #4  
Old September 5th 07, 04:26 PM posted to microsoft.public.outlook.program_forms
taborp
external usenet poster
 
Posts: 4
Default Open File from Command Button

Sue - you are AWESOME! This works perfect! Thanks so much!

Penny

"Sue Mosher [MVP-Outlook]" wrote:

Since it's a Word file, you can use Word automation, along these lines:

Sub CommandButton1_Click()
strPath = "G:\Information System\Electronic Communications Policy.doc"
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open(strPath)
objDoc.Activate
End Sub

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"taborp" wrote in message ...
I have created a custom form, but would like to set a command button to open
a Word file located in a network folder. The path to the Word file is
G:\Information System\Electronic Communications Policy. I know I need to
start with Sub CommandButton1_Click(), but then do not know what else to
enter. Can anyone help? Thanks.


Ads