1 Reply Latest reply on Mar 2, 2016 4:08 AM by Mr Omkar Deshpande

    How to open a file in design binder?

    Mr Omkar Deshpande

      Hi,

         Is it possible to open a file(excel or word) attached to a part/assembly file in design binder which is not linked to source? I found APIs to attach new file or get existing file, but I am unable to open the linked file through macro.

      Thanks in advance,

       

      Regards,

      Omkar

        • Re: How to open a file in design binder?
          Mr Omkar Deshpande

          Also, i tried with OLE objects.

           

          Dim swApp As SldWorks.SldWorks

          Dim swModel As SldWorks.ModelDoc2

          Dim i As Integer

          Dim swOLEObj As OLEObject

          Dim vOleObj As Variant

           

          Sub main()

          Set swApp = Application.SldWorks

          Set swModel = swApp.ActiveDoc

          vOleObj = swModel.Extension.GetOLEObjects(0)

          For i = 0 To swModel.Extension.GetOLEObjectCount(0) - 1

          Debug.Print vOleObj(i).IsLinked

          'set swOLEObj = vOleObj(i).Object    'Doesn't work

          'vOleObj(i).Activate                             'Doesn't work

          Next

          End Sub

           

          While, IsLinked returns the correct value, Activate doesn't work.

          Am i missing something? or the whole exercise is wrong???

           

          Regards,

          Omkar