I have a VBA macro that puts the document number into my documents. It is working with the custft8xEAI.dot template provided by Interwoven.My problem is that it will not update the doc ID on the INITIAL save of a document. The objApplication_DocumentBeforeSave event DOES get triggered, but apparently the document is not considered an Interwoven document because at this point in the code the objDocument IS "Nothing" so it skips over the "FootActiveDocument" macro: If Not objDocument Is Nothing Then objDocument.Refresh FootActiveDocument objDocument End IfIf I save changes, it updates just fine. I've tried using just about every "event" available in here and can't find anything I can trap after the number has been assigned. IRONICALLY, I SWEAR this was working just fine the other day.Can anyone please help?Thanks so much.
JNY,Yes, that is exactly what I mean by initial save.And I do have this code in there, but the "Post on ok" event does not seem to fire. To test, I put:msgbox "post on ok" in the procedure, compiled, saved, closed and re-opend Word (a multitude of times, sigh...) but when I save a new document to worksite, the messagebox does not display. And the "FootImanDocument" macro is never run.I put msgboxes in other event procedures to see exactly which ones were triggering. Many of them were, but none once the document number existed.
Do you already have this event function in place to return the IManFileSaveCmd Object so to catch its events:Private Sub objExtensibilitySink_OnIManFileSave(ByVal objIManFileSaveCmd As Object) Set objIManFileSaveCmdSink = objIManFileSaveCmdEnd Sub
Yep, it's in there, in the SinkObject class with all the others.
JNY,I am not sure which integration mode, I'm guessing classic, but I'd have to ask the engineers to be sure. Another programmer just gave me a procedure that I added to my class library and it worked. It is:Private Sub objImportCmdSink_PostOnOK(ByVal pMyInterface As Object) Dim objDocument As Object Set objDocument = objImportCmdSink.Context("ImportedDocument") FootActiveDocument objDocument Set objDocument = NothingEnd SubThanks SO MUCH for all your help. Hopefully this will be of help to someone too!