Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Open file from a fixed directory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vicenflor - 14 Oct 2005 23:10 GMT
Hello,

For my application I'm looking for some code to open one of the files in a
fixed directory "bewaardirectorie". The user must be able to select the file
he's looking for. Now I'm using the code, but the problem with this code is
that one is still able to select another directory :

With Dialogs(wdDialogFileOpen)
       ChangeFileOpenDirectory Bewaardirectorie
       
       If .Show Then
           Openfile = WordBasic.filenameinfo$(.Name, 1)
           Else
           'ActiveDocument.Protect _
           '    Type:=wdAllowOnlyFormFields, _
           '    NoReset:=True
           Exit Sub
       End If
   End With

Any suggestions are welcome.

Vicenflor
Jezebel - 14 Oct 2005 23:30 GMT
Instead of using the built-in dialog, add a UserForm and use the
CommonDialog control. (You can use the control without displaying the form
itself, so the user won't notice a change.) CommonDialog has a Flags setting
that prevents the user changing to another directory.

But bear in mind that there's no method to achieve *enforcable* security.
The user can work around your macro if they wish; so it might be simpler
just to *ask* them to use your preferred directory.

> Hello,
>
[quoted text clipped - 21 lines]
>
> Vicenflor

Rate this thread:






 
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.