index > Visual Studio Tools for Office > saving documents

saving documents


I have a VSTO project that creates a MSWORD document from a template within my project. The document is now built, printed, and saved to a network path, all within my code, no human intervention is needed. My problem is, once the document is saved, I then get a dialog box "Do you also want to save changes to the document template?
diane06

Hi Diane

At some point, you need to inform Word that any changes in the template are "throw away". Best place to do this might be just before you send the SaveAs command. As this is being triggered by saving the document, try this:

Me.AttachedTemplate.Saved = True




-- Cindy Meister (Word MVP)
Cindy Meister
Cindy,
That is exactly what I needed, although I don't understand. I would have thought the statement would have been:
"me.attachedtemplate.saved = false
diane06

You're thinking "save" when it's "saved". You're telling Word that the attached template has not changed since last saved. Check the documentation for Template.Saved:

True if the specified document or template hasn't changed since it was last saved. False if Microsoft Word displays a prompt to save changes when the document is closed.

Molon Labe
Molon
Great, thanks for the clarification on that!
Diane
diane06
reply 5

You can use google to search for other answers

 

More Articles

VSTO Excel designer problem (Visual Studio 2005)
XLA for VSTO
Outlook Upgrade
Where to find the microsoft.office.tools.word.dll
Shared Add-in - Excel Add-in for Office 2000/xp/2003
Using user properties in Find method
How to select a task pane at startup?
VSTO 2005 with German Office 2003 Installation problem.
Range.InsertBreak generates exception
Help with Word Interop PLEASE!!! - more readable version
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Excel Addin Password
Calendar Date Range
Install with vsts team site july
Shared COM Addin with VS2005TO
the differents between Interop and Tools?
Refresh of Data / Hiden Sheet VS New VST…
Word addin for multiple versions
Capturing the message when someone just …
adding column heading from a list with V…
B2TR and VSTO v3?
Collapsible Actions Pane sections
How can I use the Page interface in the …
How to use vb to add exite effects in po…
activeCell.Value2 problem
Manual Page breaks vs automatic page bre…

Hot Articles

Fix for VSTO 2005 performance problems w…
Clicking the ListBox on the Actions pane…
Custom descriptions for UDF
Excel 2003 using VSTO
dynamic smart tag
RequestService problem with Creating Out…
Databinding in VSTO
How can I add a CommandBarButton to &quo…
Shared Add-Ins
VSTO Outlook Add-in Debug errors even fo…
table caption + id
VSTO Deployment Models
Programmatically insert a TOC entry and …
Read Excel 2003 XML Spreadsheet and save…
Office Web Components

Recommend Articles

Problem with VBA and Excel
Network problem
HHC6003: Error: The file Itircl.dll has …
I have a checkbox in my excel spreadshee…
File Download feature in ASP.NET
Publish to SharePoint?
VSTO 2005 Command Bar opening WinForm pr…
Office add-in using ATL/C++ with NO .NET
VSTO,Actions pane?? navigation buttons.
add sheet
VSTO and Word menus doesn't merge
making worksheet read only
Excel file very slow to save
Excel 2007 file saving
Inserting some read only text inside the…