![]() |
|
#3
|
|||
|
|||
|
Thank you Paul
![]() I am very grateful for your help! I inserted your code but I'm getting 'Compile Error: Expected End Sub'. The first line of text was highlighted yellow in the error. Code:
Private Sub CommandButton1_Click()
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
Last edited by macropod; 10-29-2014 at 01:23 PM. Reason: Replicated oversized screenshot with actual code |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Choose file name Save As macro
|
gbaker | Excel Programming | 28 | 07-22-2014 03:54 PM |
Save As Macro that changes the file name also
|
rosscortb | Word VBA | 5 | 05-19-2014 08:40 AM |
| save a file with a predetermined date in VBA | lingering | Word VBA | 1 | 03-23-2014 07:47 PM |
Word Macro: Save file as text with current file name
|
jabberwocky12 | Word VBA | 2 | 10-22-2010 12:23 PM |
| Macro will not save to normal.dot file when exiting | bobbraun | Word | 1 | 09-28-2010 06:26 AM |