A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Runtime error 5941 when clicking requirwed field contaning text



 
 
Thread Tools Display Modes
  #1  
Old July 30th, 2010, 08:21 PM
Marrick13 Marrick13 is offline
Member
 
First recorded activity by OfficeFrustration: Feb 2007
Posts: 7
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:31 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.