>>>>>The user has a button on the cutomer maintenance screen that says 'Store info in a WORD file'. I then construct a file name based on the customer number and do your shell execute function. The first time the function will bomb, since the file does not exist. I want to create the file ahead of time if it does not exist. How do I do that?
>>>>
>>>>I think if the file does not exists, you may want to activate the corresponding application for the user to create that file. Say, for the Excel or Word you can do it using OLE Automation. For other types you may simply start the application - search for RunExe samples.
>>>
>>>Bummer.
>>>
>>>This means that he will have to save the file using the complicated naming convention I use in the program. Not very elegant.
>>
>>Well, for Excel and Word is not too hard to create a new file using OLE Automation. What other types do you support?
>
>See my previous reply.
>
>It worked with automation!
>
>Now that we've come to this, am I correct that if the only files I'm dealing with are word and excel, I do not need shell execute and I can just use automation for all featrures, like opening and closing the file, etc.
Yes, you don't need ShellExecute as you can do this with automation for Word and Excel. For some other types, such as PDF or txt (notepad) it may be still helpful.
If it's not broken, fix it until it is.
My Blog