Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using value of a control to be a filename in another apps

Status
Not open for further replies.

jofet

MIS
Sep 3, 1999
32
PH
Is there a way so can i use the value of a control and make it as a default filename in saving a picture in Adobe Photoshop? Please, thanks guys!
 
Do you have code to save a picture in Adobe Photoshop? If so, post it and we can see how to modify it to specify the filename. I am assuming that you are doing this from a button on a form??? and that the control you refer to is a text box on the same form?? Kathryn


 
actually i dont have a code for that yet, am new with coding, i just call the Photoshop exe from SHELL. what id like to do is that i wanted to save what ever picture i have scanned (from Photoshop-TWAIN) and when i save it, the blank in the FILENAME box in Photoshop SAVE dialog should contain the value of the text box in a form in Access (not the default Untitled-1 filename), would that be possible?
 
I don't think that that is possible as you describe it. By using the Shell command, you are kicking off Photoshop, but you are NOT in control of it. You cannot use VBA to control it that way you can Word or Excel, for example. You may be able to do so, if there is an object library for Photoshop that Access can use. An object library is a program that tells other programs how to control it. It describes all the objects it contains and how they are related.

I would go to the Adobe website and see if there is anything on it about "Automation" or "Command Line". Automation is the word used to describe the action of controlling one program from within another. Command Line would give you ideas of what parameters you can add to the end of your Shell command.

Good luck. Kathryn


 
Thanks Kathryn! I really appreciate it! Thanks!
 
I usually don't take the time to answer any questions but it sounds like I just accomplished the same task that you are up against. I am using Corel Draw to create the majority of me graphic files, but the same code should apply to photoshop. I wanted my database to create a new graphic file in corel draw using the data from certain fields on the form to create the new file name. Then I needed the form to open the newly created file in it's native application (Corel Draw). By using the Shell function, you cannot directly open the specific file, you can only open the application in which it was created in (Corel Draw). By using the API Call "ShellExecute" instead of the "Shell" command, you can open specific files using the application that it was created in. You must do a few things before you can open the file. Here's a code flowchart:
1) First a dummy file must be created in the application in which the file will be created. This file will be a blank photoshop file. Tou database needs to know the location of this file.

2) Next your code needs to create a string equal to the file name that you want to create, then copy the dummy file to a standard location on your hard drive and rename it to the sting name that you created. (Note: be sure to include the file extension .psd in the string that you create)

3) now use the ShellExecute API Call to open the newly created file in photoshop. Note: You can only place the ShellExecute in a stand alone module. You cannot place it in the module attached to your current form.

Respond leaving me your email address, and I will try to walk you through it...Ty
 
i'll read some more about SHellExecute API first. my email address is jofet@quickweb.com.ph, i really appreciate it. thanks Ty!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top