If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Runtime error 5941 when clicking requirwed field contaning text
I have a form document with several fields which are required before the document can be saved. Variable is defined as follows:
Option Explicit Dim sInFld As String Private WithEvents wdApp As Word.Application The following code is called on the save as event for all required fields. Sub MandatoryDOCTITLE() If ActiveDocument.FormFields("DOCTITLE").Result = "" Then Do sInFld = InputBox("Please enter the Document Title.") Loop While sInFld = "" ActiveDocument.FormFields("DOCTITLE").Result = sInFld End If End Sub Runtime error 5941 occurs whenever I click on a form field bearing this code that contains text. The code executes properly and the file is saved, but the runtime error is distracting and a nuisance. Is there a reliable way to prevent it? Last edited by Marrick13 : August 2nd, 2010 at 09:44 PM. Reason: Want to withdraw-Issue was resolved. |
Thread Tools | |
Display Modes | |
|
|