A
Angyl
I'm using a bit of code to save a document as and automatically populating
the file name with form field data.
Seems to work fine...the Save As Dialog appears, the proper field names are
there for the save as, but then if you click "Save" I get a run error
"Run-time error '-2147(bunch of other numbers)'
Command failed
And that's it. Any idea what I'm supposed to do to fix this? here's the
code I'm using:
response = MsgBox("Form Complete! Do you want to save this survey now?",
vbQuestion + vbYesNo)
If response = vbYes Then
Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogSaveAs)
With dlg
.InitialFileName = "c:\Documents and Settings\My Documents\Survey -
" + ActiveDocument.FormFields("textLast").Result + ", " +
ActiveDocument.FormFields("textFirst").Result + ".doc"
If .Show Then .Execute
End With
End If
the file name with form field data.
Seems to work fine...the Save As Dialog appears, the proper field names are
there for the save as, but then if you click "Save" I get a run error
"Run-time error '-2147(bunch of other numbers)'
Command failed
And that's it. Any idea what I'm supposed to do to fix this? here's the
code I'm using:
response = MsgBox("Form Complete! Do you want to save this survey now?",
vbQuestion + vbYesNo)
If response = vbYes Then
Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogSaveAs)
With dlg
.InitialFileName = "c:\Documents and Settings\My Documents\Survey -
" + ActiveDocument.FormFields("textLast").Result + ", " +
ActiveDocument.FormFields("textFirst").Result + ".doc"
If .Show Then .Execute
End With
End If