954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

set attributes

help for this...
want to set an attribute of file.
4 status Hidden, archive, system, read only.

thank you all...

Best Regards

Neji

Neji
Light Poster
28 posts since Feb 2008
Reputation Points: 34
Solved Threads: 1
 

see this following code :
needed 4 check box, 1 textbox and 2 button.

Dim NamaFile As String
Private Sub Command1_Click()
Cmd.Filter = "All Files|*.*"
Cmd.DialogTitle = "Select Target"
Cmd.ShowOpen
NamaFile = Cmd.FileName
Text1.Text = NamaFile
End Sub

Private Sub Command2_Click()
Dim NilaiAttributes As Byte
If NamaFile <> "" Then
NilaiAttributes = (Check1.Value * 2) + (Check2.Value * 4) + _
                  (Check3.Value * 1) + (Check1.Value * 32)
SetAttr NamaFile, NilaiAttributes
MsgBox "Set attributes successfull", vbInformation, "Setting Attributes"
End If
End Sub

Private Sub Text1_Change()
NamaFile = Text1.Text
End Sub

Private Sub Text1_GotFocus()
NamaFile = Text1.Text
End Sub


Hope this helps...

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

thank you :)

Neji
Light Poster
28 posts since Feb 2008
Reputation Points: 34
Solved Threads: 1
 

loved to learn this :)

november_pooh
Junior Poster
121 posts since Mar 2008
Reputation Points: 29
Solved Threads: 0
 

I need to do the same thing, only with a folder. But I may be missing something fundamental. With VB6 I get errors on line 3 of the example code. "Object Required". That is the 'cmd.filter =' line.

What am I missing? What object is it looking for?

Thanks
-RR

RockyRhodes
Newbie Poster
1 post since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You