AnsweredAssumed Answered

Get displayed value of custom property in VBA Macro

Question asked by Pieter Jan Van Der Stoel on Feb 9, 2016
Latest reply on Feb 9, 2016 by Pieter Jan Van Der Stoel

I want to create a macro which exports the drawing as PDF, in the format: drawing name + title + date.


I created a macro which does exactly what I want when I enter a value for `title`. However in this project I want the `title` to be equal to the part name. Therefore I use this code for the `title` value:


$PRPSHEET:"SW-File Name(File Name)"


The drawing sheet displays `Title` just fine. However the macro does not work. My macro does not convert this code to the part name. I cannot figure out why. Any tips?


This is how I get the title:



    Dim swCustProp As CustomPropertyManager


    Function FormatFileLocation() As String


    Dim Title As String

    Dim bool As Boolean

    Dim val As String


    bool = swCustProp.Get4("title", True, val, Title) 'title is the name of the

                                                                               'property and has the value: $PRPSHEET:"SW-File Name(File Name)"

    end function


I tried using both `Title` and `val`, but both give the same faulty result.