B
Brian Beck
I have a form that end users have been using to submit reports. There are
numerous form fields within the document and the data within those fields is
what I'm interested in. It's relatively easy for me create a macro that
simply sets the document to save form data only and then save the data. I
figure I can just load each form up, run the macro, close the form...and
repeat. Except for one little problem. When I created these forms
originally, I had password protected them so that the user could only enter
information into the form fields. I'd like to also automate the process of
un-protecting the document, but I can't seem to figure out how to do that.
I know that I can put some code in an AutoOpen macro that I can use just for
the purpose of messing with these forms, but in using the syntax below, I
keep getting an error [Runtime error "13" Type mismatch]:
Sub AutoOpen()
With Options
.LocalNetworkFile = False
.AllowFastSave = False
.BackgroundSave = True
.CreateBackup = False
.SavePropertiesPrompt = False
.SaveInterval = 10
.SaveNormalPrompt = False
.DisableFeaturesbyDefault = False
End With
With ActiveDocument
.ReadOnlyRecommended = False
.EmbedTrueTypeFonts = False
.SaveFormsData = True
.SaveSubsetFonts = False
.DoNotEmbedSystemFonts = True
.Password = ""
.WritePassword = ""
.DisableFeatures = False
.EmbedSmartTags = True
.SmartTagsAsXMLProps = False
.EmbedLinguisticData = True
.Protect "wdNoProtection,,PASSWORD,,"
End With
End Sub
Obviously, PASSWORD would be replaced with the actual text of the password
for the form.
Any ideas are greatly appreciated.
-Brian
numerous form fields within the document and the data within those fields is
what I'm interested in. It's relatively easy for me create a macro that
simply sets the document to save form data only and then save the data. I
figure I can just load each form up, run the macro, close the form...and
repeat. Except for one little problem. When I created these forms
originally, I had password protected them so that the user could only enter
information into the form fields. I'd like to also automate the process of
un-protecting the document, but I can't seem to figure out how to do that.
I know that I can put some code in an AutoOpen macro that I can use just for
the purpose of messing with these forms, but in using the syntax below, I
keep getting an error [Runtime error "13" Type mismatch]:
Sub AutoOpen()
With Options
.LocalNetworkFile = False
.AllowFastSave = False
.BackgroundSave = True
.CreateBackup = False
.SavePropertiesPrompt = False
.SaveInterval = 10
.SaveNormalPrompt = False
.DisableFeaturesbyDefault = False
End With
With ActiveDocument
.ReadOnlyRecommended = False
.EmbedTrueTypeFonts = False
.SaveFormsData = True
.SaveSubsetFonts = False
.DoNotEmbedSystemFonts = True
.Password = ""
.WritePassword = ""
.DisableFeatures = False
.EmbedSmartTags = True
.SmartTagsAsXMLProps = False
.EmbedLinguisticData = True
.Protect "wdNoProtection,,PASSWORD,,"
End With
End Sub
Obviously, PASSWORD would be replaced with the actual text of the password
for the form.
Any ideas are greatly appreciated.
-Brian