View Single Post
 
Old 03-22-2013, 08:37 PM
WyRm WyRm is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Mar 2013
Posts: 7
WyRm is on a distinguished road
Default Adding a Save button into a document

So i was looking through the forum and a total newbie to advance stuff with office. I found this but not sure what to do to edit it for my needs.
Code:
Private Sub Document_New()
Dim StrName As String, StrDefPath As String, StrTmpPath As String
StrName = Environ("UserName") & Format(Now, "YYYYMMDD")
StrTmpPath = "Filepath for documents based on this template"
StrDefPath = Options.DefaultFilePath(wdDocumentsPath)
Options.DefaultFilePath(wdDocumentsPath) = StrTmpPath
With Application.Dialogs(wdDialogFileSaveAs)
  .Name = StrName
  .Show
End With
Options.DefaultFilePath(wdDocumentsPath) = StrDefPath
End Sub
I want to make it so it uses a particular line and the date as the saving format.

ex. One of the lines in the form is Residence:

So would like when they press the save button it would save the file as

Residence Date.doc

Can this be down and for the path's do I put in the actual path like c:\user\temp\Documents\forms

Thanks in advance

Last edited by macropod; 03-22-2013 at 10:12 PM. Reason: Added code tags & formatting
Reply With Quote