View Single Post
 
Old 07-20-2016, 02:27 AM
samuelle samuelle is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jul 2016
Posts: 2
samuelle is on a distinguished road
Default Spell check macro within macro button field doesn't work in one document

Hi,

I am using the following macro to allow spell check on a protected Word form. In one Word form, inserting a form field Macrobutton so the user can click on this to spell check the form works absolutely fine.

Code:
Sub SCForm()
   ActiveDocument.Unprotect
   Selection.WholeStory
   Selection.LanguageID = wdEnglishUS
   ActiveDocument.CheckSpelling
   ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub
I then used Alt-F9 then Ctrl-F9 to insert a field and filled in as below:
Code:
{ MACROBUTTON SCForm Please click here to spell check }
This works in one document, but in a second, longer form when clicked it simply jumps the cursor to the first form field and does nothing else. I tried copying and pasting it, starting a new document, but only ever works when there are fewer overall fields. I have check macros are enabled.

The macro itself will run in all documents via the VB Editor, it only doesn't run from the macro button. The macro itself is stored in Normal>Modules>NewMacros - I have checked the drop down to see if there are more options but it only says (General). I am pulling my hair out! Any ideas gratefully received.
Reply With Quote