Hallo zusammen,
ich habe mein genanntes Problem schon beinahe gelöst
Leider ist eine Sache für mich unverständlich.
Im Anhang ist mein User Form zu sehen, eine einfache PictureBox und zwei Buttons.
Mit dem rechten Button wird das Thumbnail des Bauteils ausgelesen und in PictureBox1 angezeigt.
Mit dem linken Button wird die PictureBox1 gecleared.
Wenn ich nun aber zu irgendeinem Zeitpunkt auf die PictureBox1 klicke lässt sicht nichts mehr einlesen und nichts mehr clearen.
Waas für mich nicht zu erklären ist
Hat dies was mit den Eigenschaften der Objekte zu tun, oder wo liegt der Haken.
Hier mein gesamter Code der hinter der UserForm liegt:
Private Sub Button1_Click()
' Get the currently active document.
Dim doc As Document
Set doc = ThisApplication.ActiveDocument
' Get the Summary Information property set.
Dim summaryInfo As PropertySet
Set summaryInfo = doc.PropertySets.Item( _
"Inventor Summary Information")
' Get the thumbnail property. When using VBA, this will
' only work with 32-bit Inventor.
Dim thumbProp As Property
Set thumbProp = summaryInfo.Item("Thumbnail")
' Get the thumbnail image.
Dim thumbnail As IPictureDisp
Set thumbnail = thumbProp.Value
' Display the image in the picture box.
PictureBox1.picture = thumbnail
End Sub
Private Sub CommandButton1_Click()
PictureBox1.picture = Nothing
End Sub
- Inventor 2015
- VBA Noob
Cheers Flo
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP