View Single Post
  #14   Report Post  
margaritta1601 margaritta1601 is offline
Junior Member
 
Posts: 2
Smile

Fixed the Run-time error 5980!! (Or at least I think I did!)

I'm using Word2003 on XP, therefore I had to tweak the AutoOpen and AutoClose macros in order for it to work as it should without popping any bug report! Nop, it doesn't give me any Run-time error 5980 anymore! YAY!

Sharing the codes below... Please note I was just a lucky beginner! Good Luck!

Sub AutoOpen()
' This macro will reassign the ENTER key when you open an existing
' Word form fields document.
CustomizationContext = ActiveDocument.AttachedTemplate
' Bind the Enter key to the EnterKeyMacro.
KeyBindings.Key BuildKeyCode(wdKeyReturn)
End Sub


Sub AutoClose()
CustomizationContext = ActiveDocument.AttachedTemplate
FindKey(KeyCode:=BuildKeyCode(wdKeyReturn)).Execut e
' Disables prompt to save template changes.
Templates(1).Save
End Sub

Margaritta

Quote:
Originally Posted by margaritta1601 View Post
Hi Dave,

I was wondering how you solve the "bug" issue... This is really frustrating... Please help!

The Macro works well until I password protect my form... that's when the Runtime error 5980 shows up!

Thank you in advance for any light!...

Marg