L
Lee.Westcott
Hi,
Not sure if this is the correct group but here goes.....
I have inherited a VB 6.0 app and as part of its functionality, it
creates a Word 2003 document from a saved custom template then
printouts the page before closing.
The issue being reported is that if the user already has word running,
after creating a new document from the VB application, Word then says
that "Normal.dot" is in use and cannot be saved.
In a nutshell, this process should all be seemless \ transparent
without out prompts from Word. I am told this was the case before the
upgrade from a previous version of word (2002).
The Code being used is....
'Set objWrdDoc = GetObject(, "Word.Application")
If objWrdDoc Is Nothing Then
bNewWrdApp = True
Set objWrdDoc = CreateObject("Word.Application")
End If
' Associate our custom template with word instance.
Set doc = objWrdDoc .Documents.Add("MyFile.dot")
'
'
' Assignment of data to bookmarks etc
'
'
'
objWrdDoc.Application.PrintOut
objWrdDoc.ActiveDocument.SaveAs "My.doc"
objWrdDoc.Application.DisplayAlerts = False
Do While objWrdDoc .BackgroundPrintingStatus = 1
Loop
'If bNewWrdApp = True Then
objWrdDoc.Application.Quit
objWrdDoc.Application.DisplayAlerts = True
Else
doc.Close
End If
Set doc = Nothing
Set objWrdDoc = Nothing
Not sure if this is the correct group but here goes.....
I have inherited a VB 6.0 app and as part of its functionality, it
creates a Word 2003 document from a saved custom template then
printouts the page before closing.
The issue being reported is that if the user already has word running,
after creating a new document from the VB application, Word then says
that "Normal.dot" is in use and cannot be saved.
In a nutshell, this process should all be seemless \ transparent
without out prompts from Word. I am told this was the case before the
upgrade from a previous version of word (2002).
The Code being used is....
'Set objWrdDoc = GetObject(, "Word.Application")
If objWrdDoc Is Nothing Then
bNewWrdApp = True
Set objWrdDoc = CreateObject("Word.Application")
End If
' Associate our custom template with word instance.
Set doc = objWrdDoc .Documents.Add("MyFile.dot")
'
'
' Assignment of data to bookmarks etc
'
'
'
objWrdDoc.Application.PrintOut
objWrdDoc.ActiveDocument.SaveAs "My.doc"
objWrdDoc.Application.DisplayAlerts = False
Do While objWrdDoc .BackgroundPrintingStatus = 1
Loop
'If bNewWrdApp = True Then
objWrdDoc.Application.Quit
objWrdDoc.Application.DisplayAlerts = True
Else
doc.Close
End If
Set doc = Nothing
Set objWrdDoc = Nothing