Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Open a Word document over a network from a commnad button on a for

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Venia - 23 Nov 2006 14:45 GMT
Hi I am trying to do what the subject line states over an internal network.
I am using Access 2002 and from the form command button I have created using
the mini wizard the VB code ends up like so (with
some subsituted path names):

Private Sub Open_LAN_ID_Tech_Request___How_Do_I_Click()
On Error GoTo Err_Open_LAN_ID_Tech_Request___How_Do_I_Click

   Dim stAppName As String

   stAppName = "Winword.exe \\servername\highlevel folder\group
folder\database folder\Working Progress\LAN ID Tech Request - How Do I.doc"
   Call Shell(stAppName, 1)

Exit_Open_LAN_ID_Tech_Request___How_Do_I:
   Exit Sub

Err_Open_LAN_ID_Tech_Request___How_Do_I_Click:
   MsgBox Err.Description
   Resume Exit_Open_LAN_ID_Tech_Request___How_Do_I
   
End Sub

I am a complete noobie when it comes to VB coding and the error message I
get from Word is:
The document or path name is not vaild. Try these suggestions.
* Check the file permissions for the document or drive.
* Use the file open dialog box top locate the document.
(C:\Documents and Settings\mylanid\...\ID)

Firstly is it actually possible to open an Office document over a network
from an Access command button??

Secondly, if it is possibly where am I going wrong with the command/string?
I do have access/permissions to the drive and document I am trying to open.

Your help is much appreciated.
Cheers Venia
Douglas J. Steele - 23 Nov 2006 15:33 GMT
Since your file name has embedded blanks in it, you must put quotes around
the file.

To include quotes in the midst of a text string in VBA, you need to double
the quotes:

 stAppName = "Winword.exe ""\\servername\highlevel folder\group
folder\database folder\Working Progress\LAN ID Tech Request - How Do
I.doc"""

(note that that's 3 double quotes at the end)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hi I am trying to do what the subject line states over an internal
> network.
[quoted text clipped - 39 lines]
> Your help is much appreciated.
> Cheers Venia
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.