1 Reply Latest reply on Jun 5, 2015 1:58 PM by Lee CS Young

    Rename Add-in for EPDM

    Jeff Gallo

      I am trying to create an Add-in for EPDM that when a Particular File type is added it will rename it, I originally tried it with the Dispatch Add-in but i could not get it to work. using the add-in help i have been able to create an add-in that flags me creates the message box when the file is added but i cannot figure out how to rename it. I think i want to use RenameEx in the iedmfile6, but I cannot figure out how to create the object that it needs to reference. I am trying to do it with VB.

       

      Thank you for your help

        • Re: Rename Add-in for EPDM
          Lee CS Young

          You'd need to create an IEdmFile6 instance. In the EmdCmd_PostAdd hook, you're given the ID of the file in the mlObject2 member of the EdmCmdData struct.

           

          Something like;

           

          Dim file as IEdmFile6
          Dim vault As IEdmVault11 = TryCast(poCmd.mpoVault, IEdmVault5)
          For Each data As EdmCmdData In ppoData
              file = vault.GetObject(EdmObjectType.EdmObject_File, data.mlObjectID2)
              file.RenameEx(poCmd.mlParentWnd, "New Name", 0)
          Next
          

           

          This is untested and I don't use VB, but it should point you in the general direction. HTH!