How can I read an attachaments slot number in VBA

I can change the slot number of an attachement in my reference dialog, but I can't find an attachement property that reads the slotnumber?!

Is there a simple way to do this?

I want to read data from my attachements in order of the slot numbers.

 

Jean-Paul

Parents
  • Hi Jean-Pual,

    Sorry for my delay response (I just read your post today). Please run my following snippet, it will get every reference's slot number by calling a MDL function.

    Declare Function mdlRefFile_getParameters Lib "stdmdlbltin.dll" (ByRef param As Long, ByVal paramName As Long, ByVal modelRef As Long) As Long
    Const REFERENCE_REFNUM As Integer = 28
    Sub GetRefSlot()
    Dim att As Attachment
    For Each att In ActiveModelReference.Attachments
       mdlRefFile_getParameters slot, REFERENCE_REFNUM, att.MdlModelRefP
       Debug.Print "AttachName = " & att.AttachName
       Debug.Print "AttachModelName = " & att.AttachModelName
       Debug.Print "Slot = " & slot
       Debug.Print "____________________________________________"
    Next
    End Sub

    HTH,

    Yongan Fu



Reply
  • Hi Jean-Pual,

    Sorry for my delay response (I just read your post today). Please run my following snippet, it will get every reference's slot number by calling a MDL function.

    Declare Function mdlRefFile_getParameters Lib "stdmdlbltin.dll" (ByRef param As Long, ByVal paramName As Long, ByVal modelRef As Long) As Long
    Const REFERENCE_REFNUM As Integer = 28
    Sub GetRefSlot()
    Dim att As Attachment
    For Each att In ActiveModelReference.Attachments
       mdlRefFile_getParameters slot, REFERENCE_REFNUM, att.MdlModelRefP
       Debug.Print "AttachName = " & att.AttachName
       Debug.Print "AttachModelName = " & att.AttachModelName
       Debug.Print "Slot = " & slot
       Debug.Print "____________________________________________"
    Next
    End Sub

    HTH,

    Yongan Fu



Children