?
Solved

Determine if file is read-only?

Posted on 2003-03-02
2
Medium Priority
?
122 Views
Last Modified: 2010-04-07
How can I determine if a file is "Read-only"
Say a file that the user have chosen on the Save Dialog Box. It just gives me an error and period! I want to say it nicely to the user: "Hey man... that's read- only!" :p
Thank you!
0
Comment
Question by:figjus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 80 total points
ID: 8051642
Private Sub Command1_Click()
Dim Atr As Integer
CommonDialog1.ShowSave
Atr = GetAttr(CommonDialog1.FileName) And vbReadOnly
If Atr = 1 Then
    MsgBox "File is Read Only"
End If
End Sub
0
 

Author Comment

by:figjus
ID: 8051718
Just what I needed. Thanks!
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question