Log in

View Full Version : Open a specific file



dspalir
04-15-2015, 01:03 AM
Hello, i have one question.

I do not know how to write code that would allow me to open those documents, which I would, for example, has indicated in textbox1. I know how to open a specific file, I do not know how to do this in the code that we will allow the opening of that document, which I labeled.

13174

I hope you will understand what did i mean. So i want to labeled one dokument, and with a click on search button i want to open this specific folder. i have path for every document in my data, i just dont know how to write a code, that will allowed me






dynamically changing a path.

tnx

jonh
04-15-2015, 07:30 AM
Not sure what you are asking so I'll just go with this :
"i just want code that will allow a dynamically changing path"


To open files you pass in the path and filename to some kind of procedure.

e.g.


OpenSomeFile "c:\some\file.txt"

or


set myfile = OpenSomeFile("c:\some\file.txt")
DoSomethingWith myfile


Your image shows two combo boxes. There are no labels so I'll guess one is the folder (I'll call it cboPath) and the other is the filename (cboFileName).

So to make your code dynamic...



OpenSomeFile cboPath & cboFileName

or


set myfile = OpenSomeFile(cboPath & cboFileName)
DoSomethingWith myfile