Code request: Set all tweaks to "no trail"

Code request: Set all tweaks to "no trail"

-niels-
Mentor Mentor
2,112 Views
21 Replies
Message 1 of 22

Code request: Set all tweaks to "no trail"

-niels-
Mentor
Mentor

Hello code guru's, i hope someone can help me with this.

 

I am doing a lot of revisions to old(er) presentation files, from before the "no trail" option was even available, and i want to make all trails visible and then set them to "no trail" so i can add my own custom trails where needed.

Doing this manually is taking a lot of time, so i was wondering if this could be automated?

It would probably have to be done with a macro, since iLogic isn't available in presentations, but i'm not even sure the "no trail" option is available in the API.

 

Is anyone willing to put some of their precious time into this?

 


Niels van der Veer
Inventor professional user & 3DS Max enthusiast
Vault professional user/manager
The Netherlands

0 Likes
Accepted solutions (1)
2,113 Views
21 Replies
Replies (21)
Message 21 of 22

g.georgiades
Advocate
Advocate

Hi, using JhoelForshav's last code block, you can use the following code.

This will make all the tweak offsets 4 times bigger.

 

Sub ScaleBy4()
    Dim oDoc As PresentationDocument
    Set oDoc = ThisApplication.ActiveDocument
    
    Dim oBNs As BrowserNodesEnumerator
    Set oBNs = oDoc.BrowserPanes.ActivePane.TopNode.BrowserNodes(1).BrowserNodes
    Dim oBN As BrowserNode
    For Each oBN In oBNs
        If oBN.BrowserNodeDefinition.Label = "Tweaks" Then
        'MsgBox "Tweaks found!"
        Exit For
        End If
    Next
    Dim tNode As BrowserNode
    For Each tNode In oBN.BrowserNodes
        Dim oPT As PublicationTweak
        Set oPT = tNode.NativeObject
        Dim oDef As PublicationTweakDefinition
        Set oDef = oPT.Definition.Copy
        oDef.Distance = oDef.Distance * 4
        oPT.Definition = oDef
    Next
End Sub

 

Using visual studio or showing hidden members in the VBA object browser, you can see all the hidden publication classes/methods for presentation/publications.

ggeorgiades_0-1658316842947.png

 

Message 22 of 22

mjkoushik
Explorer
Explorer
Thanks a Lot!. Just needed some clarification about Publications. What is relation between a publication document and presentation document. Objects for tweaking can be found in publication classes, so is both the same?
0 Likes