K
Katherine
I'm using autonew to show a userform when a new document is created from my
template. Works fine and does everything I need it to do.
Problem is, I'm now having to modify the way the template works to add in
some extra functionality, so that when a new document is created from the
template, it is possible to also open one of the previous documents created
by that same template.
I've tried to do this by popping up a messagebox before the userform is
displayed, which, depending on the response, will either allow them to browse
for the old file or just continue on as normal.
BUT (argh) because the old file was created from the same template, it runs
the userform as soon as it is opened. I just want the old document to open as
is. is there any way out of this quagmire? I've got myself in a right pickle
and have lost the ability to think logically! Code snippet below:
Sub userform_initialize()
varOpenOldFile = MsgBox("Would you like to open" & _
" a previous .rtf document?", vbYesNo, "Open Previous File?")
If varOpenOldFile = vbNo Then GoTo Start:
If varOpenOldFile = vbYes Then GoTo GetOldFile:
GetOldFile:
Dialogs(wdDialogFileOpen).Show
template. Works fine and does everything I need it to do.
Problem is, I'm now having to modify the way the template works to add in
some extra functionality, so that when a new document is created from the
template, it is possible to also open one of the previous documents created
by that same template.
I've tried to do this by popping up a messagebox before the userform is
displayed, which, depending on the response, will either allow them to browse
for the old file or just continue on as normal.
BUT (argh) because the old file was created from the same template, it runs
the userform as soon as it is opened. I just want the old document to open as
is. is there any way out of this quagmire? I've got myself in a right pickle
and have lost the ability to think logically! Code snippet below:
Sub userform_initialize()
varOpenOldFile = MsgBox("Would you like to open" & _
" a previous .rtf document?", vbYesNo, "Open Previous File?")
If varOpenOldFile = vbNo Then GoTo Start:
If varOpenOldFile = vbYes Then GoTo GetOldFile:
GetOldFile:
Dialogs(wdDialogFileOpen).Show