PDA

View Full Version : Solved: Document_Open() vs. Document_New()



white_flag
09-28-2010, 06:02 AM
Hello I need your help:

I have an document.dot with an user form. Wen this document will be open, it will take the text from some bookmarks. and wen the doc is new The userform will be filed up with the default text:

so my code is like this:

this is in "ThisDocument"


Option Explicit
Private Sub Document_Open()
Load UserForm1
UserForm1.Show vbModal
End Sub

Private Sub Document_New()

UserForm1.Show vbModal

End Sub


on userform I have the code under the command button



Private Sub UserForm_Initialize()
meniu
End Sub


then, I have the function "reload_bmk_text" that will take the text from bookmarks wen the doc will be open

ok but I can not figure how can be put this together. any ideea will be more then welcome. thx
ok .. I do not know how to do this:

fumei
09-28-2010, 01:37 PM
If it is a .dot file - a template - then ususally this is never opened. It is cloned into a new document. Therefore you use Document_New. Whenever the .dot file is used to make a new document, this procedure will execute.

Othe rthan that, you will have to give more information. I do not know what you are doing regarding bookamrks and text.

white_flag
09-29-2010, 02:30 AM
Hello Gerry

I solve the problem (the first logic was not good). and I change the tactic (now it is ok). I add another userform (that was necessary) etc ..

greetings from Belgium