Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i a support path using VBA?

Status
Not open for further replies.

vbcad

Technical User
Jul 12, 2002
159
US
I am having trouble adding a path using the sample code included here. the routine runs but overwrites my existing path. How do i retrieve the existing path and just add to it?

Sub Example_SupportPath()
' This example returns the current setting of
' SupportPath. It then changes the value, and finally
' it resets the value back to the original setting.

Dim preferences As AcadPreferences
Dim currSupportPath As String
Dim newSupportPath As String


Set preferences = ThisDrawing.Application.preferences
' Retrieve the current SupportPath value
currSupportPath = preferences.Files.SupportPath
MsgBox "The current value for SupportPath is " & currSupportPath, vbInformation, "SupportPath Example"

' Change the value for SupportPath
newSupportPath = "TESTPATH"
preferences.Files.SupportPath = newSupportPath
MsgBox "The new value for SupportPath is " & newSupportPath, vbInformation, "SupportPath Example"

' Reset SupportPath to its original value
preferences.Files.SupportPath = currSupportPath
MsgBox "The SupportPath value is reset to " & currSupportPath, vbInformation, "SupportPath Example"
End Sub
 
You need to add your additional paths to the current string.

Try this

newSupportPath = currSupportPath & ";" & "C:\Temp"
preferences.Files.SupportPath = newSupportPath

Use a semi colon between paths.

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top