You are visitor number since 2 October 2004.
Go to Howard Kaikow's home page
Date: 2 October 2004
From: Howard Kaikow <email@example.com>
Subject: Passing Userform as an argument to a procedure (Excel and Word)
In order to access the Caption of a Userform, I am passing the Userform as an argument to a procedure.
If I pass the Userform as an Object, then the code works as intended. If I pass the Userform as an MSForms.Userform, the code does not work properly. I've seen the same behavior in both Excel and Word (Office 97, 2000, and 2002, not yet tested in Office 2003). I have provided examples, for both Word and Excel. In each case, run the code beginning with the StartHere procedure.
In one case, the caption is treated as an empty string.
In the other case, the caption is displayed in the "body" of the Userform rather than in the title bar.