Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Normal.dot problem when closing word after VBA opens it

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I am working on a mail merge document, which part of the specification is the user wishes to have the final document open to edit it before printing.

I use the following code...
Code:
    If sView = "Yes" Then
        Set WordApp = CreateObject("Word.Application")
        WordApp.Documents.Open sWord
        WordApp.Visible = True
        If vbNo = MsgBox("Are you happy with the document?", vbYesNo) Then
            sDoUpd = "No"
            Set WordApp = Nothing
            KillFile sWord
            Exit Sub
        End If
    End If

    Set WordApp = Nothing
    SetAttr sWord, vbReadOnly
    Exit Sub

however when the open word doc is closed I keep getting the following error in word...
normal.gif


How do resolve this issue?

Thanks,
1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Found the answer...
Code:
        WordApp.NormalTemplate.Saved = True
placed after making the document visible.

found fix via


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top