Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Making Files Read-only


Hi,

I need to be able to change the read-only property on files (mostly word documents) before opening them with ShellExecute.

Can anyone help?

Thanks,

Adrian Osmond.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Need Helps Making VBA Read And Scan Text Files
Hi
I know how to make VBA read text fles (using eof), but now I want use the VBA to scan for keywords and assign theirs values to variables for creating object in AutoCAD. For example

text file contents for creating a cylinder
-------------------

radius = 10

-------------------

Here is the code I'm working on
-------------------

Public Sub CreateCylinder()

Dim CylinderObj As Acad3DSolid
Dim x_center(0 To 2) As Double
Dim x_radius As Double
Dim x_height As Double

Dim TextLines As String
Open "TestFile.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, TextLines

****missing****

Loop
Close #1

x_center(0) = 5
x_center(1) = 5
x_center(2) = 0
x_height = 20

' Create the cylinder in model space
Set CylinderObj = ThisDrawing.ModelSpace.AddCylinder(x_center, x_radius, x_height)

End sub

I can't figure out what to put in Do-Loop to make VBA read the value of "10" for radius and assign it to x_radius. Any helps would be appreciated.

When I Make A (install) CD-Rom All Attributs Files Changed To Read Only Why? Read Only
I would like to my attributs files look the same after the installation. But when I create the cd all the files took the properties read only.

And in my programme,I need to write in some files.

Who can help me ?

Sorry for my bad english.

Redg
Thanks a lot.

Making .exe That....please Read
Hello again. I was wondering is it possible to code an .exe file that will copy an application/program to a directory but the program itself is contained within the .exe program?

Thanks for any input.

Making A File Read Only
Does anyone know how to change the attributes of a file so that the file is read only? Here is what I am looking to accomplish.

I have a routine that creates an EDI text file. I would like to display it to the user before it gets sent electronically. I have all of this working.

I shell out to Notepad to display the file and then wait for Notepad to close. Once it is closed I ask the user if they would like to send the file.

I would however like to change the file attribute to read only so that if a user mistakenly types in Notepad it will not corrupt the file specifications.

Does anyone one how I can do this.

Thanks,
D

EX:

Code:
SendFile = BuildEDIFile
''here is what I need help with
'Set SendFile as Read only
shellwait "notepad.exe " & sendfile
'Set SendFile as Read/Write

Making Vb Read Name.mdb File
hello im making a security program just for my own experience. i made .mdb program and when my vb form load i want it to open. to do so i use this code.

Private Sub Form_Load()
objNewAcc.DatabaseName = App.Path + "Accounts.mdb"
End Sub

but i get an error-- "unrecognized database format"

what am i doing wrong
did i create the file wrong?
if so what is the right way of making .mdb file to work with vb

Making A File Read Only
Hi,
I need to save an Excel file from VB where the attribute is set to read only. Is there anyway to prevent the user from being able to modify this attribute back to read/write (i.e. disable the attribute after I have set it so only I can enable it again)
Thanks

I NEED SERIOUS HELP MAKING A DLL FILE!!!! Read Here
hello.

I am very new to visual basic i got 6.0 version i know my way around it and still don't know how to make a dll. because i have this problem, i'll explain

i downloaded a dll called "msnslang.dll and when i added it into my msn messenger root folder it changed some of the msn script and i was baffled and jelous because i wanted to make one but did not have a clue and i wondered how this bloke done that. did he open the dll in some sort of viewer or something or edit the dll through vb. i really esant to know but can't explain it very well but if anyone knows what i am talking about please help me thnax

cya,
micky

Making A Sql Database Read-only
I am trying to configure a database as "Read Only"

If i execute the following query, i get a message saying that this query cannot be completed because there are users using this database eventhough I have no users access this database.

sp_dboption 'my_db','Read Only','True'

So, if I try to make my database offline by

sp_dboption 'my_db','offline','True'

I still get the message saying that one or more users accessing the database when I am absolutely sure that there are no users accessing this database.

What is the problem??

Thanks
Zack

Making RichTextBox Read Only
Hi, I was wondering if it is possible to make a RichTextBox read-only, but still allow the user to highlight text? I know you can change the RichTextBox property Enabled to False, and this will make it read only, but then the user cannot highlight anything in the text (nor drag (with drageffectcopy) to another text box).

Basically, I would like the user to be able to customize portions of the text, and copy text to another text box; but not allow them to delete or insert text...

Thanks in advance for your help.
Jim

Making A Text Box Read As An Integer.
Can someone give me code as to how I could make it take the data in a text box and run it as an integer instead of text. For instance if i set text1.text to 1 and text2.text to 2 instead of text1.text + text2.text to come out as 12 I want it to come out as 3. Also, an example of how to set it up to say error if it's a letter in the box would be good too, thanks.

Making A File 'Read Only' Access?
Yeah, I need to make either a file or a folder 'read-only' access.
That's all really, I just use VB6.

MSN Messenger Bot Making Help Pleaze Read Here!!!!!!
hello i am new to programming i started because i wanted to make a bot for msn messenger u may of heard of, hellstorm, project energiser, and so on,

the thing is i dont have a clue on how to even start making it i ask people who make bots and they wont even give me tutorials or they codes for their bots for me to learn from so will someone on here plz help me by posting there bot codes or tutorials or any piece or info/help


thnx cyas

micky

Memory Can't Be Read When Making An Executable
I'm try to package my vb6 program, but everytime i try to make it an executable, i get the message "The instruction at '0x0be954b' referenced memory at '0x00000010'. The memory could not be read. What is causing this problem. Thanks.

Need Suggestions/help On Game I'm Making! Please Read!
Hi, im making a rpg game. Ive pretty much gotten through the easy parts, but now comes the hard part. Ive taken 8 photos, with my digital camera of corse. I have patched them all together into 1 photo. So now its the entire room/setting in one photo.(I set the camera in the center of the room, and took pictures in a circle, then pasted them together with adobe photoshop 5.)Now I have a large(long) picture of the room. It seems that you are standing in the center. My goal is to have the player move 360 degrees.Which is shown in the photo. Now, This is where i need some help and suggestions. I placed the photo in a picturebox, I then placed a button and a clock. When the button was pressed, i had the photo in the picturebox move slightly. I did this quickly before going to bed, by having it increase the "left" of the photo. smart or stupid, i dont know. All i know is that it moved the photo. Now any suggestions on any easyer way to do this, also how would i possibly make it so, when the end of the photo is reached, it loops back to the beginning? This is probally confusing you, sorry for the bad discription, but i could not explain it any better. So I would appreciate and suggestiong/help i can get, THANX A LOT!

Need Suggestions/help On Game I'm Making! Please Read!
Hi, im making a rpg game. Ive pretty much gotten through the easy parts, but now comes the hard part. Ive taken 8 photos, with my digital camera of corse. I have patched them all together into 1 photo. So now its the entire room/setting in one photo.(I set the camera in the center of the room, and took pictures in a circle, then pasted them together with adobe photoshop 5.)Now I have a large(long) picture of the room. It seems that you are standing in the center. My goal is to have the player move 360 degrees.Which is shown in the photo. Now, This is where i need some help and suggestions. I placed the photo in a picturebox, I then placed a button and a clock. When the button was pressed, i had the photo in the picturebox move slightly. I did this quickly before going to bed, by having it increase the "left" of the photo. smart or stupid, i dont know. All i know is that it moved the photo. Now any suggestions on any easyer way to do this, also how would i possibly make it so, when the end of the photo is reached, it loops back to the beginning? This is probally confusing you, sorry for the bad discription, but i could not explain it any better. So I would appreciate and suggestiong/help i can get, THANX A LOT!

Making Excel Cells Read-only Using VBA
Hai Code gurus,I got a problem. I am using VBA editor in Excel. I have written
a macro to get the data from ORACLE and print it on EXCEL. Now I want to make some cells read-only. Nobody should be allowed to change those particular cells. How can I do that?. Pls give your solution

With Regards

Ravi

Question On Making A Listbox A Read Only Item
I am working with a list view option and having information displayed. I do not want the user to manipulate the data in the list view. Any ideas on making the list box read only controls.

Dave

Solution: Making An Access Form Read-only
Here is a solution to a problem I've had since last August. I wasn't working on it full time though.

Based on a network login id, I wanted to make an Access form "read-only" sometimes. Here's how I did it.
Code:
Private Sub Form_Open(Cancel As Integer)
    
    Dim lngCanEdit As Long
    Dim lngListCount As Long
         
     On Error GoTo Form_Open_Err
     
    lngCanEdit = CanEdit
    
    If lngCanEdit = 1 Then
'Don't need these two either.
        'Me.AllowAdditions = True
        'Me.AllowDeletions = True
        'I had to remove this for the drop down lists to work.
        'Me.AllowEdits = True
        Me.RecordsetType = 0 'Dynaset. This was the breakthrough.
    ElseIf lngCanEdit = 2 Then
'Don't need these two either.
        'Me.AllowAdditions = True
        'Me.AllowDeletions = True
        'I had to remove this for the drop down lists to work.
        'Me.AllowEdits = True
        Me.RecordsetType = 2 'Snapshot. This was the breakthrough.
    Else
'Don't need these two either.
        'Me.AllowAdditions = False
        'Me.AllowDeletions = False
        'I had to remove this for the drop down lists to work.
        'Me.AllowEdits = False
        Me.RecordsetType = 2
    End If

    lngListCount = Me.cboCaseSearch2.ListCount
    lngListCount = Me.cboCaseSearch3.ListCount
    
DoCmd.Maximize

Form_Open_Exit:
    Exit Sub
    
Form_Open_Err:
    MsgBox prompt:=Err.Number & ", " & Err.Description & ", Form_Open in frmCreateCaseProfile.", _
        buttons:=vbInformation + vbOKOnly
    Cancel = True
    Resume Form_Open_Exit
    
End Sub

------------------------------------------------------------------------------------------------
Put your PC to good work at vbCity at world community grid and join Team vbCity.
2,669,763 3,325,308 points and ranked 1,195 1,149 as of March 8 May 23, 2008!
------------------------------------------------------------------------------------------------

Edited by - Geof on 4/7/2008 9:28:31 AM

Help With Making This(HARD! One)Icon And Exe Binder- Open To Read..
here it is

Code:
1) the code must be small( or make it as small as possable)
2) there are other things that my app does( the code youmake must be able to intergrate into it)
3) thereisnt any user interaction.
4) any thing else we'll hammer outlater
5) im loaded with $$$bills

textPath.Text = full path Ppath & Pfilename
Ppath = path c:~~~
Pfilename = the exe's filename

first, i need a icon extrator, it will create an icon( the defalt icon of the exe){icons name is the exefiles name ~~ exename.ico)
in the dir of the exe, the exe path is textPath.Text
that icon will stay there and then it will contineue to the next line of code, wich is the exe binding.
textpatha.Text<- this is the one that startsup first] is the 1st file to be binded and textPath.Text
is the 2nd, and the icon of the 2 binded files exe result is that icon i talked about a few lines ago.
the result of the binding is put in the windows temp dir{ + its own subfolder} as the orginal exe filename,
then it will kill exename.ico, kill the orginal exe, name; copy the binded result in the wintemp dir to
the path of the orignal exename, then cleanup and move on. there must be a code to see if the wintemp subfolder it makes is already there -

binding( join 2 exes togeter so they both run at the same time)
_____________________
freel free to email me!

Read PDF Files / Extract Data From PDF Files
I wondering IF it's possible to read data from pdf files?

This because I would like to write a sub for pdf files like below:

Code:

Text = ReadWordDocument("C:TempTest.doc")

Public Function ReadWordDocument(strFileName As String) As String

Set oWordApp = CreateObject("Word.Application")
If oWordApp Is Nothing Then Exit Function

Set oWordDoc = oWordApp.Documents.Open(strFileName)

oWordApp.Selection.WholeStory
ReadWordDocument = oWordApp.Selection.Text

oWordApp.Quit

Set oWordDoc = Nothing
Set oWordApp = Nothing

End Function

Help On Reading Excel Files And Then Making Data Reports Using These Excel Files
Hello.I would like to know how to get from an excel file specific data,using Visual Basic and then how to make with them data reports!I would appreciate any help,advise.

Thank you

Making Help Files
What software should i use to make Help files for my app ? Like i came to know about INNO Setup is there any freeware and easy to use Help maker also ?

ty

About Making EXE Files
if i turn my program into an EXE file , it should play on most computers right?

cus i sent my client to an older computer and it wouldn't unzip it, it needed a program to open it.

i guess it doesn't have the right library.

Making X Files
Does anyone know where I could find a good 3D drawing program for making X files

Making Help Files In VB
I have problem in making Help Files in VB.
I want the complete guide in creating Help Files such as, any component on creating Help File,or any other way in creating the same.

Making Web Files
I need to know if there is a better way to create web pages in visual basic besides writing to a file and naming it with a ".html" extention. I am creating a software that will allow the user to create his/her own web site. Somethink like what dreamweaver does but no as roboust and probrably not with the drag and drop capabilities. I just dont want to start using the filesystemobject to make files if there are easier ways to do it. Your input would be greatly appreciated.

Making HELP Files
Do you create Windows format HELP files for your apps, or is that too much of a job for everyday programs?

I've searched msdn for info, but I still haven't found THE tutorial on authoring help files. I noticed that early in VB 6 it looks like Microsoft switched to HTML help files from .rtf, but I still haven't found the specifics to get going.

What do you Experienced VB developers do?

Thanks again - Tom

Making Help Files
Does anyone know of a good way to make .HLP files, or any good free programs that make professional looking .HLP files? I want to document my program. Thanks.

Making Help Files?
I want to make a chm file. how do i do that? is there a free program i can download, one that doesnt have any missing featuers or trial or anything?

Making Dll Files?
Okay ihave some class and module files that i want to compile to dll files.

How do i do that. Is it just open e new project and paste the module in it and compile it like an dll file or???

Do i have to have any required subs???

/Thanx

Making Exe-files
Hi everybody.
I have a lot of forms connected to a database and a lot of .rtf and .help files. What am I supposed to do when deploying if I want all files to be installed to the same folder during installation?

Making Help Files?
Hmm..

I found out that you are suppose to use
visual foxpro to make help files and I
dont have the program.. Because I bought
Vb alone. Well So is there another way
to do it?

Would it be a problem to give me a little
general information about the help system
... Im alittle lost.

Making HELP Files
How do you make helpfiles? Please replay this topic, I've wondered about this for a long time.

Making HELP Files
How do you make helpfiles? Please replay this topic, I've wondered about this for a long time.

Making RTF Files
Was wondering how to send an e-mail that looks like a simple web page. A block of text at the top, and then several pictures with captions. Basically, a real estate listing.

Are there commands to make an RTF file...
Then insert JPGs or GIFs?

Was thinking about putting the result into the clipboard and then pasting inside Outlook to keep things simple.

Is this workable?

Thanks,
Scott

Making RTF Files
Was wondering how to send an e-mail that looks like a simple web page. A block of text at the top, and then several pictures with captions. Basically, a real estate listing.

Are there commands to make an RTF file...
Then insert JPGs or GIFs?

Was thinking about putting the result into the clipboard and then pasting inside Outlook to keep things simple.

Is this workable?

Thanks,
Scott

Making PRN Files.
Hi Everybody.

Can Anyone Tell me how make and print PRN files through Visual-Basic.

Thanks in Advance.

Help Reg Making EXE Files
How can I make EXE files using VB. New To VB .Please Reply

Making A Help Files
What is the best way to make a help file for winhelp32?

Daniel Prinz

Making Backups Of Files
I'm almost done with a program, and have run into a problem. basically this program copies files to a different directory, and I have that part working, but I want to make backups of the old files. Does anyone know of a component, module, or quick way to achieve this?

Here's an example:

I have 3 files (file1.txt, file2.jpg, and file3.php) in each folder, and a total of 5 folders. There's another location on the hard drive that is structured the same, but has 8-10 files per folder and 18 folders. I can copy the 15 files correctly, but I want an automated way to create backups of the 15 files before coping the new ones. I could just rename the files and process each file one at a time, but this program needs to copy all of the files in the folders, not neccisarially just the 3 per folder, so I can't hardcode the files to move.

Other helpful things to know would be if there's a way to get a file list from of a folder (including it's subfolders), or once again, a component/module that can handle this for me. I'm currently using "SHFileOperation", and it copies just fine, but I can't get it to make backups of the files before over-writing them. Thanks in advance.

Making An Installation Files. Tell Me How?
I have some problem to ask u guyz:

1. My whole class was on System Analysis Assignment last year. After making an .exe files and also making an installation files using package & deployment wizard, we entered some problems. When we tried to install the system on other PCs there was a message saying that my database file was not found or something like that. I had ensure that all my adodcs connected perfectly

Was it because I did not assemble all the items needed in drive C? For your information, I assemble all my forms, database and other items in drive D.

I ask others about this and they said that I must assemble all the items on drive C. I mean just put them on drive C without folder.

It turns out well when I try to install the system on my PC. My stupidity needs your best guide.

2. While making an installation files using package & deployment wizard, must I include the .exe files?

3. Can the users access the database after we install the system on their pc?

4. What is the best way to make Help file?

5. What is option explicit all about and how do I use it?

(Plz forgive my way of writing becoz I am not so good in English. I'm a Malaysian by the way)

Making Config Files....
Hi i am making a program so that when you have chosen the settings you prefer u have the option to save (in the form of a command button) but i dont know how to save/load data fro ma file :S. please if any of you help me i will be forever greatful

Thanks In Advance .

Nathan.

Making Wav Files Smaller
need to get some of my program files smaller so i can upload to certain visual basic websites. Was looking at the size of my sound effect files ( wav files) and found out that some of the shortest sound effects were over 300 times the size of the longer ones.
This seems to be due to the bit rate being 16 or 64 kbps and 1411 kbps on the really big ones. Can i save the real big ones ( 1411 size) as maybe 16 or 64? and how would i do this?

Making Save Files
Okay, I'm making a Scrapbooking program for my mother and I have most of the program figured out. However, a thing that has been bugging me is that I can't make a save file of my own extension. I have consulted MSDN numerous times and gotten as far as having the Property Bag and SaveAs method recommended but it doesn't answer my problem. Can someone suggest a method or even better supply a snippit of code that I can follow as a template. (Note: I also need to be able to access select areas, much like you do when using the Windows Registry.)

Thanks in advance.

Making Executable Files
I'm just starting Visual Basic. To make the first project an executable file the manual says to click on file and then click on Make (project).exe. When I try this the Make (project).exe is dimmed and can't be selected. What's wrong?

Making PDF Files From CSV's Inside VB 6
I have a program that exports information from a database to a csv file. I would also like to have it automatically create a pdf file of the csv inside vb at the same time.

Is there an easy way to do this? I tried adobepdfwriterX but I can't seem to get it to recongnize it inside vb.

Any Suggestions

Kelly P

Making Personal Files
Hi All,
I have some questions about saving file as personal. On my project i saving my program result as txt file. I want to change this file icon type as my program icon and make when user click on this file my program start with these data.
I have also one question, for example user saved active project and after save he(her) made some changement. When user click save button again i want to save last changement on recent file (not new). If user want to save file on different files, he(she) will use Save As method. How can i solve it ?
Thanks
Levent

Making HTML Files.
Ok my mate is in the process of making a new site. And he has a list of 500+ words that he has to make a page for.

So he would load a list of words, and then it would make a file called

word.html
word1.html
word2.html

is this possible within VB ?

Part 2 of request

Ok if that is possible, would be possible to have some default code in each file aswell.


Code:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<title>IntelliGambler.com</title>
</head>
<body>
<center>
<table width="650" height="500" bgcolor="#EEEEEE">
<tr>
<td valign="top">
<table border="0" cellpadding="0" cellspacing="0" class="outline" width="645" align="center">
<tr>
<td valign="center" align="center" background="images/mainhead.jpg" width="600" height="34">
<p align="center"><b>
<font face="Papyrus" size="3" color="#FFFFFF">Wild Card</font></b></td>
</tr>
<tr>
<td class="right_content">
<p align="left">A card, such as a joker or a designated
rank, that can be assigned any rank and suit.<p align="left"><a href="javascript:history.go(-1)">Back
to Glossary</a></td>
</tr>
</table></td></tr></table>
</center>
</body>
</html>




so i would end up with a html file for each of the words with that code in them.

Hope this is clear.

Making .rul Files With Text In It
hello,

ik working on a prog that makes scripts for a game(this is not an illegal trainer)
but i have not got a qlue of what i must do.

i just want something that opens a file and then alter the text
can some-one also tel me how i can use hex or byte in it

please,

tossos

Copyright © 2005-08 www.BigResource.com, All rights reserved