"Save Changes To Templates"

Add-in Express™ Support Service
That's what is more important than anything else

"Save Changes To Templates"
the saga continues =( 
Sven Heitmann




Posts: 193
Joined: 2004-08-23
Hi,

I get that annoying dialog after I add a new Document by a Wizard...

I know you fixed this in the past, but I think because the Word Thread is interrupted while the Wizard is running (Dialog) it is not working.

Can you give me some info where do I find the position of the fix in your source?

Best regards,
Sven

(ADX 2.1 Latest Build)
Best regards,

Sven Heitmann
Posted 10 Jan, 2005 08:32:22 Top
Sven Heitmann




Posts: 193
Joined: 2004-08-23
Ok, it seems I solved it now... I hope it's gone forever

I add an EventListener for Word to the Module with the following code

private void adxWordEvents_DocumentBeforeClose(object sender, AddinExpress.MSO.ADXHostBeforeActionEventArgs e) {
	MarkTemplateSaved();
}

private void adxWordEvents_DocumentBeforeSave(object sender, AddinExpress.MSO.ADXHostBeforeSaveEventArgs e) {
	MarkTemplateSaved();
}

private void MarkTemplateSaved() {
	Word.Document oDoc = null;
	Word.Template oTemplate = null;
	try {
		oDoc = _oWordHost.ActiveDocument;
		oTemplate = oDoc.get_AttachedTemplate() as Word.Template;
                if(_oWordHost.NormalTemplate.FullName != oTemplate.FullName
			&& oDoc.FullName != oTemplate.FullName) {
			oTemplate.Saved = true;
		}
	} catch {}
	Utils.ReleaseComObject(oTemplate);
	Utils.ReleaseComObject(oDoc);
	Utils.ReleaseComObject(oDoc);			
}
Best regards,

Sven Heitmann
Posted 10 Jan, 2005 11:00:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Sven,

This code is quite similar to the one I wrote for the latest ADX version.
Did you download ADX version 2.2 build 1749 on the link I gave you?
Posted 10 Jan, 2005 11:30:11 Top
Sven Heitmann




Posts: 193
Joined: 2004-08-23
Yes, but I have not installed it yet because I had to do some quick bugfixes for my addin based on the 2.1 adx.

However I will give it a try today...
Best regards,

Sven Heitmann
Posted 11 Jan, 2005 01:42:15 Top
Sven Heitmann




Posts: 193
Joined: 2004-08-23
I tried it, and it does not work when I use 2.2 only
Best regards,

Sven Heitmann
Posted 11 Jan, 2005 04:52:39 Top