Kilroy
10-25-2016, 09:37 AM
OK I've done a lot of research and can't piece together what I need. There numerous posts asking for this so hopefully someone can help me tweek this a bit. This code opens a small window asking what you want to name your new document only if it's new which suits me fine but I can't figure out how to get it ask for a location. It just picks an open folder or defaults to the "documents" folder. Is there a way to tell it where to store the file? like a save as window?
Sub SaveAsDocFile()
Dim strDocName As String
Dim intPos As Integer
strDocName = ActiveDocument.Name
intPos = InStrRev(strDocName, ".")
If intPos = 0 Then
strDocName = InputBox("Please enter the name " & _
"of your document.")
Else
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".docx"
End If
ActiveDocument.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatDocument
End Sub
Sub SaveAsDocFile()
Dim strDocName As String
Dim intPos As Integer
strDocName = ActiveDocument.Name
intPos = InStrRev(strDocName, ".")
If intPos = 0 Then
strDocName = InputBox("Please enter the name " & _
"of your document.")
Else
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".docx"
End If
ActiveDocument.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatDocument
End Sub