I would like to create a button which opens a PDF file with changing index numbers. For example, the file name is TEST_01.PDF and changes to TEST_xx.PDF from time to time. Obviously a normal link won't work here.
After adding the button, edit it to change the line specifying the folder you want it to look in.
The script inside the button looks like this:
Function OnClick(ByRef clickData)
Dim cmd, folderEnum, folderItem, folderPath
folderPath = "C:\Folder Path\With\A PDF In It"
Set cmd = clickData.func.command
cmd.deselect = false
Set folderEnum = DOpus.FSUtil.ReadDir(folderPath, False)
Do While (Not folderEnum.complete)
Set folderItem = folderEnum.Next
If (UCase(folderItem.ext) = ".PDF") Then