colinmitton
Technical User
I have created a word form and have then created a macro to save the document twice. Once is the form in words format the second is the form data to be upload to a DB.
I have the code here :
What I need to do now is make the 'save' name currently "Data Collection Form" a prompt at the beginning so when the person filling out the form presses the button to run this macro puts the relevent filename in then the macro does the rest.
I've done simular in Excel but have failed on this one!
Thanks in advance
I have the code here :
Code:
Sub formsaving()
ChangeFileOpenDirectory "\\server1\form\"
ActiveDocument.SaveAs FileName:="Data Collection Form.doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
With ActiveDocument
.SaveFormsData = True
End With
ChangeFileOpenDirectory "\\server1\formdata\"
Application.DefaultSaveFormat = ""
ActiveDocument.SaveAs FileName:="Data Collection Form.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
With ActiveDocument
.SaveFormsData = False
End With
Application.DefaultSaveFormat = ""
End Sub
What I need to do now is make the 'save' name currently "Data Collection Form" a prompt at the beginning so when the person filling out the form presses the button to run this macro puts the relevent filename in then the macro does the rest.
I've done simular in Excel but have failed on this one!
Thanks in advance