random vector pattern script

Sub VectorPattern_random1() Dim OrigSelection As ShapeRange Dim s As Shape Dim patternFolder As String Dim patternFiles As Collection Dim fileIndex As Integer ' Define the path to the CorelDRAW default pattern folder patternFolder = "C:\Users\admin\Documents\Corel\Corel Content\Fills\Vector\" ' Initialize the collection to hold the pattern file names Set patternFiles = New Collection ' Get the list of .FILL files in the folder Dim file As String file = Dir(patternFolder & "*.fill") Do While file <> "" patternFiles.Add patternFolder & file file = Dir Loop ' Check if any pattern files were found If patternFiles.Count = 0 Then MsgBox "No pattern files found in the specified folder: " & patternFolder, vbExclamation, "Error" Exit Sub End If ' Get the selected shapes Set OrigSelection = ActiveSelectionRange ' Loop through each shape in the selection For Each s In OrigSelection ' Select a random pattern file from the collection Randomize ' Initialize random number generator fileIndex = Int((patternFiles.Count) * Rnd + 1) Dim randomPatternFile As String randomPatternFile = patternFiles(fileIndex) ' Apply the vector pattern fill Dim patternStyle As String patternStyle = "{""fill"":{""fillName"":""" & randomPatternFile & """,""type"":""10""}}" ' Apply the pattern fill using the constructed style string s.Style.StringAssign patternStyle Next s End Sub

vector pattern is applying but vector pattern or content is not showing, what is the problem, please someone help