WalkerEvans
Technical User
Hi!
Can anyone shed some light on this? I am getting the following error:
Run-time error '4198'
Command Failed
This is showing up at the bottom of a macro that opens a Word document, allows changes to be made, prints and deletes that document and then opens a form-field document which is then printed and closed (in theory). The problem is that I keep getting the above error after everything but the close is done, leaving me with an open form-field document containing sensitive data.
What we have here should be simple; I've used this same line in many other macros and it has worked flawlessly. I'm at a loss to understand why it is failing here. The full code in this section is (problem line hi-lited):
Help!
----------------------------------------------------------------------------------
[small]"What was the psychiatric diagnosis of the man who jumped into the river in Paris?"[/small]
"He was in Seine!"
Can anyone shed some light on this? I am getting the following error:
Run-time error '4198'
Command Failed
This is showing up at the bottom of a macro that opens a Word document, allows changes to be made, prints and deletes that document and then opens a form-field document which is then printed and closed (in theory). The problem is that I keep getting the above error after everything but the close is done, leaving me with an open form-field document containing sensitive data.
What we have here should be simple; I've used this same line in many other macros and it has worked flawlessly. I'm at a loss to understand why it is failing here. The full code in this section is (problem line hi-lited):
Code:
Sub ender3()
For Each aField In ActiveDocument.FormFields
Count = Count + 1
Next aField
For j = 1 To Count
ActiveDocument.FormFields(j).Select
With Selection.Find
.Text = "0"
.ClearFormatting
.Replacement.Text = "Ø"
.Replacement.ClearFormatting
.Execute Replace:=wdReplaceAll, Forward:=True
End With
Next j
ActiveDocument.FormFields(1).Select
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=("xxxx")
Count = 0
Call GetOut2
End Sub
Sub GetOut2()
'Prints form, reactivates Spell & Grammar
'Checks, then closes form without Save
ActiveDocument.PrintOut
ActiveDocument.ShowSpellingErrors = True
ActiveDocument.ShowGrammaticalErrors = True
[highlight]ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges[/highlight]
End Sub
Help!
----------------------------------------------------------------------------------
[small]"What was the psychiatric diagnosis of the man who jumped into the river in Paris?"[/small]
"He was in Seine!"