By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,646 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,646 IT Pros & Developers. It's quick & easy.

How to grayed 'Read only' in property of Explorer of Windows with VB?

P: 2
There was the same question reported in 2005 and was wondering if there was an answer to this question somewhere ...
Dec 5 '07 #1
Share this Question
Share on Google+
2 Replies


kadghar
Expert 100+
P: 1,295
There was the same question reported in 2005 and was wondering if there was an answer to this question somewhere ...
I dont know if this is good for all versions of VB, but give it a check:

Expand|Select|Wrap|Line Numbers
  1. dim MyFile as io.fileinfo = my.computer.filesystem.getfileinfo("c:\AnyFile.xls")
  2. myfile.isreadonly = true
HTH
Dec 5 '07 #2

P: 2
I dont know if this is good for all versions of VB, but give it a check:

Expand|Select|Wrap|Line Numbers
  1. dim MyFile as io.fileinfo = my.computer.filesystem.getfileinfo("c:\AnyFile.xls")
  2. myfile.isreadonly = true
HTH
Thanks a lot. That is not really working for me BUT while I was trying it, it lead me to the solution. I used:
Expand|Select|Wrap|Line Numbers
  1. ActiveDocument.ReadOnlyRecommended = True
ant it seems to work. I can still change the Windows Property, but it looks like the read-only permissions is set internaly and it doesn't get affected even when I change the permission from Windows explorer.

Thanks

GLP
Dec 7 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.