How can I handle only the document which is being edited by the user?

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

How can I handle only the document which is being edited by the user?
Word and Excel BeforeSave Event 
Destaque Empreendimentos em Informática




Posts: 40
Joined: 2011-03-10
Hi for all,
I'm developing an AddIn to upload the document when it is saved. To do this I'm handling the DocumentBeforeSave event but, some times, this method is receiving a ".dot" or ".dotm" file to manipulate, but I'm not interested in these kind of files. So, I'm using an IF statement to ignore those files.
But, I'm thinkin if there are another file type that I should ignore too. Or if is there another test to ensure that I'm handling the correct file (that is, the active document)? Maybe using the file name, or comparing the file name received on DocumentBeforeSave and the file name from Application.ActiveDocument...

How can I handle only the document which is being edited by the user?

Regards,
Sergio
Posted 02 Dec, 2014 07:26:41 Top
Andrei Smolin


Add-in Express team


Posts: 14129
Joined: 2006-05-11
Sergio,

You can compare Document.FullName for the document being saved and the document returned by WordApp.ActiveDocument.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 02 Dec, 2014 08:35:53 Top
Destaque Empreendimentos em Informática




Posts: 40
Joined: 2011-03-10
I'll try.

Thank you Andrei.

Sergio R. S.
Posted 02 Dec, 2014 10:39:53 Top