Word AutoOpen / ThisDocument.Reload

dickohead

Registered User.
Local time
Tomorrow, 07:41
Joined
Dec 7, 2005
Messages
42
Hello all,

I am trying to create a macro that sits in my Normal.dot file that enables me to reset/reload certain documents I am working on.

In these documents I have some prompt boxes being loaded up from an AutoOpen() sub:

Code:
Sub AutoOpen()
'Asks the user if they wish to prompted for input or not.

vAnswer = MsgBox(Prompt:="Do you wish to be prompted for form data?", Buttons:=vbYesNo)

If vAnswer = 6 Then
    fFirstName
    fLastName
    fAddress
    fSubStateCode
    MsgBox ("All Done.")
Else
    Exit Sub
End If

This code, or at least the AutoOpen() function is in every document I need to reset.

How do I recall this function once the document has been loaded up, filled in and printed? At the moment if you need to do two of the same letter you have to close it and open it again for the AutoOpen() function to be recalled.

I have tried creating word macros in the Normal.dot template that do the following, but to no avail:
Code:
Sub Reset_Documents()
    With ActiveDocument
    Autoload 'function from the current document
    End With
End Sub
and
Code:
Sub Reset_Documents()
    With ActiveDocument
    .Reload
    End With
End Sub

But the first gives an error, as I expected, and the latter only resets the fields, it doesn't rerun the AutoOpen() function.

Anyone got an answer?

Cheers,

dickohead.
 

Users who are viewing this thread

Back
Top Bottom