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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to ignore read-only file notification.

Status
Not open for further replies.

meintsi

Technical User
Jul 22, 2002
181
US
How do I "squish" the notification you get when opening a read-only file.

*Remember.......
If you don't use your head,
your going to have to use your feet.
 
Just change the file attributes to vbNormal before opening, then set then back to vbReadOnly, using SetAttr statement:

SetAttr "myFile.txt", vbNormal

Check out the other constants in VBHelp under SetAttr


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
But if the user saves during use I don't want the original file touched.

I'm trying to use the read-only file as a template where after a series of user inputs, a SaveAs is forced.

Or is there an easier way I'm missing? (Using a template in the particular application is not possible)

*Remember.......
If you don't use your head,
your going to have to use your feet.
 
If you want to use it as a template, use FileCopy to get an editable version and use that:

Filecopy "myTemplate.txt", "myDummy.txt"
SetAttr "myDummy.txt", vbNormal


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top