473,327 Members | 2,118 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,327 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
Nov 21 '05 #1
4 2178
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: frankvfox | last post by:
I am struggling to export Excel spreadsheets to the client machine in an ASP.Net application. Everything was great until exporting Excel got into the act. Documentation on MSDN is so poor regarding...
4
by: Matt Howard | last post by:
I was wondering if anyone had any code samples on how to call functions within a Microsoft Access module using ASP.NET. I found a posting on how to do it with C#, but does anyone know how to do it...
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 ...
2
by: Alex Maghen | last post by:
Hi. I've seen several KBs on using .NET for MS Office Automation. But I have a particular question: I am developing a somewhat stand-alone .ASPX page which will need to do some relatively simple MS...
1
by: Stelios Skiathitis | last post by:
I 'm thinking of using the Microsoft COM object to develop an asp.net page that will generate a word document from data filtered from an SQL server database. When the application is going to be...
11
by: | last post by:
Hi! How to extand and access the internat Office object structure. Is there any Dev Kit for Microsoft Partners that in not available to "normal" users? Something like NOKIA back entrence!? ...
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 (...
2
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability,...
2
by: Sonia | last post by:
Hi all, I have couple of questions on MS Webservices : Do they have some published webservices : Like a webservice to convert an excel or .mpp into xml ? If yes where to locate them and how...
0
by: frederick.the.fool | last post by:
I'm writing a project that does Visio automation. I'm writing it in C+ +/CLI because it needs to reference a good amount of native C++ code. One way to call the Visio API, of course, is to use...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.