Message 1 of 4
Does this code look correct?... Rename browser names to match file names
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I asked Chat GPT Plus to:
Here's the code:
' Get a reference to the active assembly document
Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
' Loop through all components in the assembly
For Each oComp As ComponentOccurrence In oDoc.ComponentDefinition.Occurrences
' Get the file name of the component
Dim sFileName As String = oComp.Definition.Document.FullFileName
' Extract the file name without extension
Dim sNameWithoutExt As String = System.IO.Path.GetFileNameWithoutExtension(sFileName)
' Rename the browser node to match the file name
oComp.Name = sNameWithoutExt
Next
I get this error when I try to run it, but I don't know what it means or what to fix/change