problem with Sync....
Hello,
i m trying to sync a word document from "NRTEcho" to Desksite ..
i want it to be done as soon as user close a word document...
(basically, when user closes the document it leaves a copy in NRTEcho directory and i m modifying that document by attaching a template and then i want it to sync - replacing original document)
in my add-in, i have..
Dim myDoc As IManage.IManDocument
Dim myresults As IManage.IManSyncResult
myresults = myDoc.SyncWithResults(nrtechodocfullname, imCheckinDisposition.imCheckinReplaceOriginal, Now)
If myresults.Succeeded Then
MsgBox("Sync successful")
Else
MsgBox("Error in Sync - " & myresults.ErrorMessage)
End If
and i am getting error" object reference not set to an instance of an object"
..
not sure what to do?
any suggestions!!
B
i m trying to sync a word document from "NRTEcho" to Desksite ..
i want it to be done as soon as user close a word document...
(basically, when user closes the document it leaves a copy in NRTEcho directory and i m modifying that document by attaching a template and then i want it to sync - replacing original document)
in my add-in, i have..
Dim myDoc As IManage.IManDocument
Dim myresults As IManage.IManSyncResult
myresults = myDoc.SyncWithResults(nrtechodocfullname, imCheckinDisposition.imCheckinReplaceOriginal, Now)
If myresults.Succeeded Then
MsgBox("Sync successful")
Else
MsgBox("Error in Sync - " & myresults.ErrorMessage)
End If
and i am getting error" object reference not set to an instance of an object"
..
not sure what to do?
any suggestions!!
B
0
Comments
-
hi,
Please look at this snippet which is a modification to my previous post !!!
---------------------------------------------
'Assume that myWS is a live WS...
Dim myDoc As IManage.IManDocument
Dim myresults As IManage.IManSyncResult
'Just Added this line
myDoc = myWS.Database.CreateDocument()
myresults = myDoc.SyncWithResults(nrtechodocfullname, imCheckinDisposition.imCheckinReplaceOriginal, Now)
If myresults.Succeeded Then
MsgBox("Sync successful")
Else
MsgBox("Error in Sync - " & myresults.ErrorMessage)
End If
'-------------------------------------------------------
This code executes and returns the myresults.ErrorMessage as "Document is checked out" ???
can someone please point out the issue here...or an alternative to sync a documnet from the Echo directory.
thanx in adv.
b0 -
This strikes me as something very dangerous to do...
What kind of "Add In" is this? An iCommand object you are adding to DeskSite/FileSite? It doesn't look like a Word add-in...
I don't know why you are using SyncWithResults...?
If you are attempting to do something to the Word file, I would suggest you look at a Word add-in (Startup template) that intercepts the Close event, checks out the document again, does your processing, then checks the document back in.
Perhaps I don't understand what you are trying to accomplish...0 -
Is there code between the lines of CreateDocument and SyncWithResults? Typically, when you are creating a new document object, you must also profile the document object with required values. Also, if you're synching an existing/open WorkSite document, why would you be creating another document object?? You're getting the Checkedout error probably because the file that is in your nrtechodocfullname is still opened when you make the SyncWithResults call. Most importantly, you cannot use this method to checkin a newly created document object.
Overall, based on your code snippet, it does not make much sense, or seem logical, to accomplish what you're attempting to do.
You might want to consider this excerpt documented in the COM Reference Manual for WorkSite.pdf in your further pursuit:
The IManSyncResult object is returned as a result of the SyncWithResults method on the IManDocument object. SyncWithResults is used to copy a document to the database that has been edited locally while the document was not checked out by the current user. The SyncWithResults method is very similar to the Checkin method, except that it cannot be used to import new documents to the database, and it operates on documents that are not checked out by the current user. The SyncWithResults method can only succeed when the current user is the last user to edit the document.0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 156 General Questions
- 151 Thrust Services
- 57 Developer Hackathon
- 38 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 33 eDOCS
- 193 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories
TeamSite Developer Resources
If you are interested in gaining full access to the content, you can register for a My Support account here.
- Docker Automation
- LiveSite Content Services (LSCS) REST API
- Single Page Application (SPA) Modules
- TeamSite Add-ons
If you are interested in gaining full access to the content, you can register for a My Support account here.