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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coding Question about DoComand

Status
Not open for further replies.

DomFino

IS-IT--Management
Jul 9, 2003
278
US
Hi all,
I have a function that creates a file and saves it.
The file is FDF format used to import data to a PDF form.

Currently the file is created, notepad opens to view the file, and then I can manually exit the FDF file. Then I must go to the saved FDF file and double click it to open and execute.

What I want to do is create the file, and have the file execute.

My question is what command(s) do I use to do this within my function? Any ideas?

Code:
 . . . 
 . . .  
Close #aFileNum

Shell "Notepad.exe \\bigguy\users\dom_f\Access\Forms\Query.fdf", vbMaximizedFocus

. . .
. . .
 
Close #aFileNum
Set S = CreateObject("WScript.Shell")
S.Run "Notepad.exe \\bigguy\users\dom_f\Access\Forms\Query.fdf", 3, True
S.Run "\\bigguy\users\dom_f\Access\Forms\Query.fdf"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hello Again PHV,
I added your suggest code and it almost does the trick except for one thing. The notepad file opens (full screen) with the data. Once I close notepad using the X top right of screen, it works perfectly. Meaning, Acrobat opens, the PDF file is displayed, and all the data inserted.

I do not need to see the notepad file at all. Is there a way to bypass this step with your code?
Thanks,
Dom
 
I'm confused.
If you don't need to make changes with notepad, simply don't launch it.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PH,
I am an idot. I commented out the one line of code and it works exactly as I want.
Code:
S.Run "Notepad.exe \\bigguy\users\dom_f\Access\Forms\Query.fdf", 3, True
I will keep the line of code in for testing to make sure the data is correct, but in production I will comment it out.
Thanks so much for your help once again.
Dom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top