By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,065 Members | 1,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,065 IT Pros & Developers. It's quick & easy.

Microsoft Office Automation

P: n/a
Hi All,

We have a module that needs to automate word 2000 for certain added
functionality. I have successfully created the component to do this.
Basically I start word using a statement like

_word = New Word.Application

Then I proceed to sink the word events that I need.

Once everything is completed, I unsink the events and quit word using the
statement

_word.Quit( SaveChanges:=Word.WdSaveOptions.wdPromptToSaveChan ges,
Missing.Value, Missing.Value)

Everything works fine except for a recent problem we discovered. If the user
has already an instance of word running, then when the code tries to quit
the automated word application, I get the following message

This file is in use by another application or user. (C:\Documents and
Settings\...\Normal.dot")

When I click Ok, it displays the SaveAs dialog. I cancel this dialog. Then
when I attempt to close the automated word application manually, I get the
following error message

Changes have been made that affect the global template, Normal.dot. Do you
want to save changes?

Could some one point me in the right direction to avoid these messages from
popping up. Is there any way I can turn off these messages or somehow
indicate that the global template Normal.dot has not been modified.

I am using Visual Studio .NET 2003 and Word 2000. In the automated word
application I am modifying the ways in which certain menus and toolbar
buttons of word should behave.

Thanks,

Raju
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Raju,

Can you pls post the code ?
I will try & simulate this thing & see where the problem is occurring &
why ?

Kalpesh

Nov 21 '05 #2

P: n/a

You are prompting to save changes when you quit - of course it is going to
give you these message boxes.


"Raju Joseph" <vz******@msn.com> wrote in message
news:er**************@tk2msftngp13.phx.gbl...
Hi All,

We have a module that needs to automate word 2000 for certain added
functionality. I have successfully created the component to do this.
Basically I start word using a statement like

_word = New Word.Application

Then I proceed to sink the word events that I need.

Once everything is completed, I unsink the events and quit word using the
statement

_word.Quit( SaveChanges:=Word.WdSaveOptions.wdPromptToSaveChan ges,
Missing.Value, Missing.Value)

Everything works fine except for a recent problem we discovered. If the
user has already an instance of word running, then when the code tries to
quit the automated word application, I get the following message

This file is in use by another application or user. (C:\Documents and
Settings\...\Normal.dot")

When I click Ok, it displays the SaveAs dialog. I cancel this dialog. Then
when I attempt to close the automated word application manually, I get the
following error message

Changes have been made that affect the global template, Normal.dot. Do you
want to save changes?

Could some one point me in the right direction to avoid these messages
from popping up. Is there any way I can turn off these messages or somehow
indicate that the global template Normal.dot has not been modified.

I am using Visual Studio .NET 2003 and Word 2000. In the automated word
application I am modifying the ways in which certain menus and toolbar
buttons of word should behave.

Thanks,

Raju

Nov 21 '05 #3

P: n/a
All you need to do is set the Word option controlling this behavior using
the Options property of the Word application class instance.

Options.SaveNormalPrompt = False

I don't know if this option is available in Word 2000, but it should be. You
could also open an instance of Word and set this property manually before
running your program.
"Raju Joseph" <vz******@msn.com> wrote in message
news:er**************@tk2msftngp13.phx.gbl...
Hi All,

We have a module that needs to automate word 2000 for certain added
functionality. I have successfully created the component to do this.
Basically I start word using a statement like

_word = New Word.Application

Then I proceed to sink the word events that I need.

Once everything is completed, I unsink the events and quit word using the
statement

_word.Quit( SaveChanges:=Word.WdSaveOptions.wdPromptToSaveChan ges,
Missing.Value, Missing.Value)

Everything works fine except for a recent problem we discovered. If the
user has already an instance of word running, then when the code tries to
quit the automated word application, I get the following message

This file is in use by another application or user. (C:\Documents and
Settings\...\Normal.dot")

When I click Ok, it displays the SaveAs dialog. I cancel this dialog. Then
when I attempt to close the automated word application manually, I get the
following error message

Changes have been made that affect the global template, Normal.dot. Do you
want to save changes?

Could some one point me in the right direction to avoid these messages
from popping up. Is there any way I can turn off these messages or somehow
indicate that the global template Normal.dot has not been modified.

I am using Visual Studio .NET 2003 and Word 2000. In the automated word
application I am modifying the ways in which certain menus and toolbar
buttons of word should behave.

Thanks,

Raju

Nov 21 '05 #4

P: n/a
Okay,

I found the problem and fixed it.

Reason why Word was prompting me to save Normal.dot file because I modified
the default behavior of certain Word menus and toolbar buttons.

All I had to do was before closing the word application was to place the
following code

Application.NomalTemplate.Saved = True

everything seems to be okay.

Thanks a lot guys,

"Peter Bernhardt" <pe***@nospam.com> wrote in message
news:uZ**************@TK2MSFTNGP11.phx.gbl...
All you need to do is set the Word option controlling this behavior using
the Options property of the Word application class instance.

Options.SaveNormalPrompt = False

I don't know if this option is available in Word 2000, but it should be.
You could also open an instance of Word and set this property manually
before running your program.
"Raju Joseph" <vz******@msn.com> wrote in message
news:er**************@tk2msftngp13.phx.gbl...
Hi All,

We have a module that needs to automate word 2000 for certain added
functionality. I have successfully created the component to do this.
Basically I start word using a statement like

_word = New Word.Application

Then I proceed to sink the word events that I need.

Once everything is completed, I unsink the events and quit word using the
statement

_word.Quit( SaveChanges:=Word.WdSaveOptions.wdPromptToSaveChan ges,
Missing.Value, Missing.Value)

Everything works fine except for a recent problem we discovered. If the
user has already an instance of word running, then when the code tries to
quit the automated word application, I get the following message

This file is in use by another application or user. (C:\Documents and
Settings\...\Normal.dot")

When I click Ok, it displays the SaveAs dialog. I cancel this dialog.
Then when I attempt to close the automated word application manually, I
get the following error message

Changes have been made that affect the global template, Normal.dot. Do
you want to save changes?

Could some one point me in the right direction to avoid these messages
from popping up. Is there any way I can turn off these messages or
somehow indicate that the global template Normal.dot has not been
modified.

I am using Visual Studio .NET 2003 and Word 2000. In the automated word
application I am modifying the ways in which certain menus and toolbar
buttons of word should behave.

Thanks,

Raju


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.