I’ve searched on internet for days and I got the codes to create a shortcut of a libreoffice file on desktop.
I’ll write it over here if anyone needs it.
Sub CreateShortCut
Dim WshShell As Object
Dim DeskTopPath As String
Dim sFile as String
Dim oShellLink as object
Dim sFullPath as String
GlobalScope.BasicLibraries.LoadLibrary("Tools")
WshShell = CreateObject("WScript.Shell")
DeskTopPath = WshShell.SpecialFolders.Item("Desktop")
sFullPath = ThisComponent.getLocation()
sFile = FileNameoutofPath(GetFileNameWithoutExtension(ThisComponent.getLocation()))
oShellLink = WshShell.CreateShortcut(DeskTopPath & "\" & sFile & ".lnk")
oShellLink.TargetPath = sFullPath
oShellLink.Save
End Sub
edit by @karolus escaped Code with Backtics