Maintaining Active Document Between Userforms 
Author Message
 Maintaining Active Document Between Userforms

I've created a userform for construction of a document. One option involves
calling another userform with event code inserting still more text. The two
userforms both work as designed except the second inserts its text in a
different document than the first.

I tried assigning the first userform's active document to a variable and
then referring to that variable in the second userform event code but am
missing something. The editor tells me its an undefined variable in the
second form. I tried declaring the variable as public in the event
declaration (treating the event like a module) for the first userform but it
didn't work.

I have the sense that the answer is simple once you know it. What am I
missing?



Sun, 05 Jan 2003 03:00:00 GMT  
 Maintaining Active Document Between Userforms
Hi Alan,

I assume both userform are in the same project. If so, try declaring the
object variable that refers to the document as Public in a normal code
module instead of the UserForm module.

--
Hope this helps.
Regards
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.


Quote:
> I've created a userform for construction of a document. One option
involves
> calling another userform with event code inserting still more text. The
two
> userforms both work as designed except the second inserts its text in a
> different document than the first.

> I tried assigning the first userform's active document to a variable and
> then referring to that variable in the second userform event code but am
> missing something. The editor tells me its an undefined variable in the
> second form. I tried declaring the variable as public in the event
> declaration (treating the event like a module) for the first userform but
it
> didn't work.

> I have the sense that the answer is simple once you know it. What am I
> missing?



Sun, 05 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. UserForms values and multiple document fields

2. Multiple UserForms in a Word Document

3. UserForms and moltiple documents in Word 2000

4. UserForms for fields on protected documents

5. Macro to insert text or document into active document

6. Adding a Document to the active contact

7. Active Document behaviour

8. Save As with Active Document Name +1

9. OnLineView of active document

10. active documents

11. Counting the pages in an active document

12. check active document

 

 
Powered by phpBB® Forum Software