In the code below, the file name is hardcoded, but I want the user to be able to select it.
I read about GetSaveAsFilename
, but I get an error when using it: "method or element not found".
fileSaveName = Application.GetSaveAsFilename _ (fileFilter:="Excel Files (*.txt), *.txt")
This is written for Word 2010. Am I wrong in thinking GetSaveAsFilename
is available in the word VBA?
Sub Macro3() ' ' Macro3 Macro ' ' ActiveDocument.SaveAs2 FileName:="Questionnaire01-05-20122.txt", _ FileFormat:=wdFormatText, LockComments:=False, Password:="", _ AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _ EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _ :=True, SaveAsAOCELetter:=False, Encoding:=1252, InsertLineBreaks:=False, _ AllowSubstitutions:=False, LineEnding:=wdCRLF, CompatibilityMode:=0 End Sub
source share