Hi All,I'm importing a document using the ImportCmd and setting various fields either via its ContextItems or within the onInitDialog event. I'm have problems with setting the boolean field Custom25, heres code snippets:' ContextItemsContext.Add "IManExt.Import.Custom25", "true"----------' Within onInitDialog'oDlg cast from pMyInterface objectoDlg.SetAttributeValueByID nrCustom25, "true", True-----------Neither method sets the field as expected. I've tried passing in a boolean/numeric datatype, but this also fails.Any Ideas?Thanks,RW
Hi jny,I've tried the "Y" and "N" values but the custom25 field still defaults to NULL. Tried this in using the ContextItems collection and the onInitDialog event procedure. RW
Hi jny,I tried 0/1 within the onInitDialog procedure and that has no effect:Private Sub oImport_OnInitDialog(ByVal pMyInterface As Object) Dim oDlg As NewProfileDlg Set oDlg = pMyInterface oDlg.SetAttributeValueByID nrCustom25, 1, True Set oDlg = NothingEnd SubAlso, i've tried setting it when using the ImportCmd's ContextItems....'SnippetWith oContextItems .Add "ParentWindow", winHandle .Add "IManExt.NewProfile.ProfileNoUI", true If Not (oFolder Is Nothing) Then .Add "DestinationObject", oFolder Else .Add "DestinationObject", oDatabase End If .Add "IManExt.CalledFromIntegration", True .Add "IManExt.Import.FileName", wordDoc.FullName .Add "iManDMS", oManDMS .Add "iManExt.Import.KeepCheckedOut", True .Add "IManExt.Import.Custom25", "Y" End WithThanks,RW
My Apologies jny, I've also tried this with ProfileNoUI = false (where it does populate pMyInterface correctly) and still get the same result....thanks,RW
Option Explicit' Event handlers to ImportCmd and NewProfileDlg ObjectsPrivate WithEvents oCmd As IMANEXTLib.ImportCmdPrivate WithEvents oDlg As IMANEXTLib.NewProfileDlg' ServerPrivate Const SERVER_NAME = "DSS_WIN2003SERV"Private Sub Form_Load() Dim oContext As IMANEXTLib.ContextItems Dim oNewDoc As IManage.NRTDocument Dim oDMS As New IManage.NRTDMS Dim oSess As IManage.NRTSession Dim sPath As String Dim i As Long On Error GoTo ERROR_HANDLER ' Login Set oSess = oDMS.Sessions.Add(SERVER_NAME) oSess.TrustedLogin sPath = "C:\Temp\Document5.docx" Set oContext = New IMANEXTLib.ContextItems ' Required values oContext.Add "DestinationObject", oSess.PreferredDatabase oContext.Add "ParentWindow", Me.hWnd ' Optional values oContext.Add "IManExt.Import.FileName", sPath oContext.Add "IManExt.Import.DocDescription", "Testing preprofiling." oContext.Add "IManExt.Import.DocAuthor", oSess.UserID oContext.Add "IManExt.Import.DocClass", "DOC" Set oCmd = New IMANEXTLib.ImportCmd oCmd.Initialize oContext oCmd.Update oCmd.Execute On Error Resume Next Set oNewDoc = oContext.Item("ImportedDocument") MsgBox "Document is imported as docnum: " & oNewDoc.Number & "_" & oNewDoc.Version & ", " & oNewDoc.GetAttributeByID(nrCustom25) GoTo CleanupERROR_HANDLER: MsgBox Err.Description Err.ClearCleanup: ' Logout and close app If Not oSess Is Nothing Then If oSess.Connected Then oSess.Logout oDMS.CloseApplication End If End If ' Free pointers Set oContext = Nothing Set oCmd = Nothing Set oNewDoc = Nothing Set oSess = Nothing Set oDMS = Nothing End End SubPrivate Sub oCmd_OnInitDialog(ByVal pMyInterface As Object) ' You may preset validated lookup fields and default security here. Set oDlg = pMyInterface oDlg.SetAttributeValueByID nrCustom25, 1, True Set oDlg = NothingEnd Sub