Click here to Skip to main content
15,867,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have very strange error here for which we could not find any solution. I hope VB6 ,word expert could help us in this.

We have our code in VB6. There is a functionality in the code in which we send the word documents to client/users through the code. Word documnets have bookmarks in them. During send operation code creates word object, generates the bookmarks in the ActiveDocument and send it to client.

However, users are getting below error while sending the documents. We have tried tried users scenarios in our local machines the error does not get reproduced. Below is the error description through the log for the user.

Error Description -2147417851 Method '~' of object '~' failed
Source RevisionDLL CGCDocWordApp:ActiveBookmarkSet Method
RevisionDLL CGCDocWordApp:GetNextTypeBookmark Method
RevisionDLL IDocument:GenerateDocument Method
DistribDll IDistribution::PrepareDoc
Note: The error occuring when the documents are in bunch. and the error is inconsistent. We checked the MDAC version of all servers. MDAC version are matching

Which googled around for all possible solutions but neither solution is working for us.
Posted
Updated 21-Jan-19 22:03pm
Comments
CHill60 9-Feb-15 7:49am    
I have seen a similar error then the pathname to the word document was "too long" - if you are using the full dns path try mapping a drive to the file location and using that - if that works then it is the length of the path that is the problem and you'll have to find a way to shorten it
Richard Deeming 9-Feb-15 9:57am    
That error tends to be raised when an exception is thrown during a late-bound call. If possible, try using early binding to see if you get any more information.
Member 11438562 10-Feb-15 10:06am    
Hi All,

Thank you for you reply I will impliment the solutions provided by you all.

And let you all know about the status.

Thank you so much.:)
Member 11438562 11-Feb-15 3:35am    
Hi Richard,
Following is the code which is shown in the error description.

Public Sub ActiveBookmarkSet(iIndex As Integer, Optional szBookmark As String = "")
On Error GoTo ActiveBookmarkSetErr
Dim iErrorTimes As Integer

iErrorTimes = 0
If Not moBookmarks Is Nothing Then
If iIndex > 0 Then
If miActiveBookmarkCount >= iIndex Then
Set moBookmark = moBookmarks.Item(iIndex)
mszActiveBookmark = moBookmark
End If
ElseIf szBookmark <> "" Then
If moBookmarks.Exists(szBookmark) = True Then
Set moBookmark = moBookmarks.Item(szBookmark)
mszActiveBookmark = moBookmark
End If
End If
Else
mobjRevision.objError.RaiseError CWORDERR_BASE_NoActiveBookmarks, App.EXEName & "::CGCDocWordApp::ActiveBookmarkSet", ""
End If
Exit Sub
ActiveBookmarkSetErr:
iErrorTimes = iErrorTimes + 1
If iErrorTimes < 6 Then
Resume
End If
& "::CGCDocWordApp:ActiveBookmarkSet Method", "")
Call mobjRevision.objError.RaiseError(Err, App.EXEName & "::CGCDocWordApp:ActiveBookmarkSet Method", Err.Description)
End Sub
Member 11438562 11-Feb-15 3:36am    
Does any body know what could be the issue causing this inconsistent error.

1 solution

"Download COMMTB32.DLL and copy at same Directory as VB6.exe" Worked for me
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900