View Single Post
 
Old 10-28-2014, 04:04 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use a macro like:
Code:
Sub Demo()
Dim StrPth As String
StrPth = "C:\Users\" & Environ("Username") & "\"
With ActiveDocument
  .SaveAs2 FileName:=StrPth & "\Documents\NURS_353_Clinical_Evaluation_" & _
    Replace(.FormFields("Client").Result, " ", "_") & "_" & _
    Format(Date, "MM.DD.YYYY") & ".PDF", _
    FileFormat:=wdFormatPDF, AddToRecentFiles:=False
End With
End Sub
where the formfield's internal bookmark name is 'Client'. The above would save the PDF to the user's 'Documents' folder.

You mention the desire to be able to save the file "anywhere on their computer or network", a process that would either require the use of a folder browser or working through the SaveAs dialogue. The latter carries with it the risk that the user would change the filename. The following version implements a browser:
Code:
Sub Demo()
Dim StrPth As String
StrPth = GetFolder & "\"
If StrPth = "\" Then Exit Sub
With ActiveDocument
  .SaveAs2 FileName:=StrPth & "\Documents\NURS_353_Clinical_Evaluation_" & _
    Replace(.FormFields("Client").Result, " ", "_") & "_" & _
    Format(Date, "MM.DD.YYYY") & ".PDF", _
    FileFormat:=wdFormatPDF, AddToRecentFiles:=False
End With
End Sub
 
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote