Question : Simple Automation with Infopath 2003 and SPS 3.0 - Calculate Directory / Filename to save as

I have a simple Infopath Form with various text fields, date fields, option buttons, etc.  I have published to form to a sharepoint "server" (actually, a server running SPS 3.0 -- the free version).  I would like to add two command buttons (say "btnDrafts" and "btnSubmit"), with the caption "Save As Draft" and "Submit to Policy Committee".  

If the user clicks on btnDraft, the form would be saved in a Drafts subfolder of the current location of the empty template, in SPS, with a concatenation of the last name of the author (txtAuthorLastName (textbox)), the title of the policy (txtTitle), the current system date (in YYYYMMDD) format, and the letters "DRF" (e.g., DoeWorkHours20091230DRF).

If the user clicks on btnSubmit, the form would be saved in a "Submit to Policy Committee" subfolder of the current location of the empty template, in SPS, with the same name, except without the "DRF" at the end (e.g., "DoeWorkHours20091230").

While the user can obviously save the form wherever they want, I'm not worried about restricting them, at this point, from saving it elsewhere using the file : Save As... menu.

Realizing that Infopath 2007 and Sharepoint Server might be more amenable to this process, it is unfortunately ruled out due to financial restrictions.

I'd prefer to use VBScript over JScript (assuming I have to use either) to perform this task, because I'm more use to Visual Basic .NET (we have Visual Studio 2008).  I'm really not that familiar with the Object Model, and getting a solid model to a tangible example in our situation might greatly assist in learning it.

Thanks!

Kevin

Answer : Simple Automation with Infopath 2003 and SPS 3.0 - Calculate Directory / Filename to save as

This is all simple.

Best practice is to disable the save and save as and have buttons like you have outlined.

No need for code.

Go to tools and Data Connections and add a submit connection to SharePoint.  Set it up for your draft locations and use a concat function to create your naming scheme.  Then create another submit connection for the policy committe.  Then just have a rule on the first button to use the draft submit and the other to use the second.

This is all standard functionality that you do not have to over complicate.  Once you try it you will see.
Random Solutions  
 
programming4us programming4us