Don't save normal.dot

D

dlevine54

We have an application that reads a text file with bookmark names and values
which is merged into a Word document automatically by a VB.NET custom program
which then prints the merged document. Everything works except that when Word
is closing it pops up a message stating that Normal.dot can't be saved
because it is already open elsewhere. It also appears to be saving it in
Document and Settings someplace. The VB app runs on an unattended server and
each time a document is merged and printed another message pops up and I
can't have all these messages hanging around. My question is; is there a way
to prevent Word from trying to save Normal.dot?

Thank you.
 
C

Charles Kenyon

Yes. Change your application so it isn't creating or changing normal.dot.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
D

dlevine54

Thanks for the reply but I'm not creating or changing the normal.dot. I open
a Word object, load a document and merge data into bookmarks, then save and
print it. There are no template changes. That's my poblem. I don't know why
it's asking to save teh normal.dot.
 
G

Greg

I don't either. It might be considered living dangerously, but if you
feel confident that nothing of consequence is changing in your template
you might try something like:

Sub Test()
Dim oState As String
'Get state at start
oState = ActiveDocument.AttachedTemplate.Saved
'Substitute the next three lines with your current code that is some
how changing
'the template
NormalTemplate.AutoTextEntries.Add Name:="Blue", _
Range:=Selection.Range
MsgBox ActiveDocument.AttachedTemplate.Saved
'Set state to start state
ActiveDocument.AttachedTemplate.Saved = oState
End Sub
 
D

dlevine54

Greg, I tried your suggestion but ' ActiveDocument.AttachedTemplate.Saved' is
not avialable in my code. That line throws an error. The only function
'ActiveDocument.AttachedTemplate' has is getType. What am I missing?
 
C

Charles Kenyon

If you have an open document,
ActiveDocument.AttachedTemplate.Saved
gives a boolean value, True or False

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top