473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Microsoft Office Automation

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
Sep 30 '05 #1
4 3512
Hi Raju,

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

Kalpesh

Sep 30 '05 #2

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

Sep 30 '05 #3
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

Sep 30 '05 #4
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


Oct 1 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jabailo | last post by:
I came across this article while researching a VB6 430 error: INFO: Considerations for Server-Side Automation of Office http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757 ...
8
by: | last post by:
Hi All, I'm tring to write an application which open .xls files and get information from them ( using .xls file as a database ). According to the MSDN (...
8
by: | last post by:
Hi All, I'm tring to write an application which open .xls files and get information from them ( using .xls file as a database ). According to the MSDN (...
7
by: jabailo | last post by:
I came across this article while researching a VB6 430 error: INFO: Considerations for Server-Side Automation of Office http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757 ...
0
by: jabailo | last post by:
I came across this article while researching a VB6 430 error: INFO: Considerations for Server-Side Automation of Office http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757 ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.