Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
J.VandeMerckt
759 Views, 8 Replies

How to Save copy as, straight into vault

Hi Forum

 

I have this line of code which saves my configurable part with a custom filename.
It works as intended.

 

Problem is I would like this file to be checked into the vault instead of saved in file explorer.

Can anyone help me change the code so the part is also checked into the vault.

 

Dim currentfilename As String
Dim choice As String
Dim length As String


currentfilename = ThisDoc.FileName(False)

choice = Parameter("FixedUnit_Curve")
length = Parameter("FixedUnit_Length")

'custom filepath
'SetTheFilePathHere = "C:\ ... your filepath ..."

'filepath same as the current ipt
SetTheFilePathHere = ThisDoc.Path

SetTheFilenameHere = currentfilename & " - " & choice & " - L" & length & "mm"


ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent, SetTheFilePathHere &"\" & SetTheFilenameHere & ".ipt")

Dim oCtrlDef
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppFileSaveCopyAsCmd")
oCtrlDef.Execute

 Thank you for helping.

 

BR

Justin