index > Visual Studio Tools for Office > What action can change .dot file

What action can change .dot file

Hi,

We've developed VSTO 2005 Word Application, which uses our own template file(xyz.dot). However, when users close the document, they get prompted for save of normal.dot file - WHICH we don't use in our application. This happens only for few users. (If they open normal word doc, there is no prompt). This is the sequence of events which happen in Doc_Load

- Create custom toobar dynamically

- Enable/Disable menu items , based on few rules

- Attach our application's template ( xyz.dot)

- Attach an XML Schema

Activities during doc edit session, would be one of the above only. No additional steps being done.

My Questions:

- Is there any activity from above, which could modify normal.dot which forces the prompt

- Additionally at times, users get prompt to xyz.dot save itself. Not sure if any of the above activities would corrupt the template file.

(We tried putting this.template.saved=true flag, but of no use.)

sraju
Is there any activity from above, which could modify normal.dot which forces the prompt
dhtroy

Whether the above actions would trigger a prompt to save changes in Normal.dot depend on which CustomizationContext you've specified. In Word, this affect where changes to CommandBars are stored. If you haven't specified it, you really need to go back and do so :-)

And if you haven't specified it, or if you did set it to NormalTemplate, then changes are being made to Normal.dot. This means that any user who has the option "Prompt to save changes to Normal.dot" activated will see the message.

It's also unclear what you mean by "attach our application's template". If this is a VSTO project, I'd expect the user to be creating a new document from the VSTO template - to what would you be attaching it, then?

You say you've tried setting the Saved property to true for the template. But if the prompt is to save Normal.dot, then you could try to set app.NormalTemplate.Saved = true, as well.




-- Cindy Meister (Word MVP)
Cindy Meister
Cindy, I've actually seen this prompt, if you open a document based on a template and change the template via the AttachedTemplate property, Word will sometimes prompt the user to save that template the moment the AttachedTemplate property is assigned/reassigned.

e.g.,

If I create a document based off a template, and make changes to the document, then attempt to break the attachment by assigning Globals.ThisDocumentAttachedTemplate = string.empty; on some machines, Word will immedately prompt to "Save changes to the template", the moment that line of code is executed regardless if Saved = true;

I'll look at the CustomizationContext you've mentioned in your post; you may have just solved one of my minor issues ... hopefully this resolves the issue for the original poster as well.


:)


-dhtroy
dhtroy

Hi D.

I wasn't arguing with you :-) I was trying to make sure the basics were out of the way, first. (Should have made that clear - sorry). I jumped in with my observations because the OP specified "Normal.dot", rather than the current AttachedTemplate prompting the message (assuming I interpreted the problem description correctly).

Interesting that you're seeing what you describe on only some machines, not others. It reminds me a bit of what I saw at a client this week. Finally, we were able to track the differences down to other Addins loaded on the machine. Depending on what was there and in which order it loaded, another Addin was making some kind of changes in open/loaded files and templates. No idea if that's any help to you... :-)




-- Cindy Meister (Word MVP)
Cindy Meister
Oh I didn't think you were arguing with me at all (you're far to nice a person for that)

I create and/or modify all sorts of commandbars and whatnot and failed to implement the application CustomizationContext property (which I now recall reading about, but then didn't use). So that's probably my problem ... I'll let you know.





-dhtroy
dhtroy

Hi Sraju

Did any of the suggestions made in replies to your question help you any further? If the issue is resolved, we should close off the thread :-)




-- Cindy Meister (Word MVP)
Cindy Meister
reply 7

You can use google to search for other answers

 

More Articles

• How to develop a new Hyperlink-like object ?
• How to add a reference to a DLL made with VS2005 (Framework 2.0) ...
• Context Menus in MS Project
• VSTO Serious Deployment Problem. NamedRange controls cannot be fo...
• row count and column count of excel file in C#
• How can I call a managed code extensions function from another pr...
• UDF in Excel XP with C#
• Threading and Word
• CASPOL / Security complaint
• Word object created in suspended thread won't close...
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Excel cell's context menu question
• Where is VSTO Installed?
• Excel 2003 XML Maps
• Automatically resize columns to fit data?
• VSTO v3 CTP
• Installing VSTO "v3" solutions
• CommandBarButton Handle??
• How can I use the Page interface in the
• excell parameters
• Error: "Excel/Word visual studio de
• insertxml in word 2007
• Getting Excel to Recognize HTML Column W
• Outllook Addin Deployement Issue
• Drag and Drop from Actions Pane to Docum
• VB.Net COM Add-In for Excel Nightmare! p

Hot Articles

• Passing Control between Excel and C# code
• OL Addin problems (two of them)
• Creating new templates
• sending to excell with VB
• Start Access DB Macro from VB.NET
• Smart Tags in Outlook 2003
• Read Excel 2003 XML Spreadsheet and save
• Suspending the Word background repaginat
• Shared Add-In
• Still Unable to Show/Hide NamedRange obj
• Caption on custom ActionPane
• Inserting Page numbers into Excel
• Issue with InsertXML method
• Network write access problem?
• How do I submit a BUG for office in gene

Recommend Articles

• Add menu button in multi-lingual environ
• How can i refer DLL created in .NET in V
• Excel XML Auto Column Width
• Help! How to identify nodes of Infopath2
• Action Pane Holder Customization
• TSQL issues
• Word sub-menus not visible in VSTO 2005
• filling the Multiple ranges
• Cutomize File menu in Excel using VSTO 2
• Problem with Canceling Outlook applicati
• Accessing a Pre-existing Shape on a Work
• Can't start VSTO 2003 projects anymore
• Workbook VBA project stays in memory aft
• Insert contents of a byte[] or stream ob
• Custum defined functions in Excel