Hi,

I am experiencing problems with the MoveWithinTree method.

I get the following error number and message when the MoveWithinTree
method is called:

Error number = -2147417848
Error description = "Method '~' of object '~' failed"

when I run the code, pasted below.

The code runs without a problem when launched within the Visual Studio 6
design environment, but fails every time I run the 'packaged & deployed'
executable.

I am using VB6 SP5.
The GroupWise domain is version 6.0.4
GroupWise SDK released 27 Feb 2006.
OS = Win XP Pro.

Can anyone explain why my code works within the design environment and not
outside?

Many thanks in advance,

Andy

========================

Code Snippet:

Public Function blnMoveWithinTree(ByVal strPostOffice As String, _
ByVal strEmailID As String, _
ByVal strDestinationContainerDN As
String) As Boolean
'
'This procedure moves an NDS user object to another container.
'
' strPostOffice - Post office of object to be moved.
' strEmailID - Email ID of object to be moved.
' strDestinationContainerDN - Destination container (Distinguished Name).
'
'Note mDomain is the data type AdminTypeLibrary.Domain and represents the
'connected domain.
'
Dim PO As AdminTypeLibrary.PostOffice
Dim GWUser As AdminTypeLibrary.User
Dim strEvent As String
'
On Error Resume Next
'
'Assume the worst:
blnMoveWithinTree = False
'
'Instantiate the post office object.
Set PO = mDomain.PostOffices.Item(strPostOffice)
If Err.Number <> 0 Then
Debug.Print "Failed to instantiate post office object."
Debug.Print "Err Number: " & Err.Number
Debug.Print "Err Description: " & Err.Description
GoTo Cleanup
End If
'
'Instantiate the GroupWise user object.
Set GWUser = PO.Users.Item(strEmailID)
If Err.Number <> 0 Then
Debug.Print "Failed to instantiate user object."
Debug.Print "Err Number: " & Err.Number
Debug.Print "Err Description: " & Err.Description
GoTo Cleanup
End If
'
'Move the NDS user object.
Call GWUser.MoveWithinTree(strDestinationContainerDN)
If Err.Number <> 0 Then
Debug.Print "Failed to move user object."
Debug.Print "Err Number: " & Err.Number
Debug.Print "Err Description: " & Err.Description
GoTo Cleanup
Else
Debug.Print "User moved ok."
End If
'
'Having reached this far, the move procedure appears to have been
successful.
blnMoveWithinTree = True
'
Cleanup:
Set GWUser = Nothing
Set PO = Nothing
'
End Function