Using this in Module
Option Explicit
Public Const SFID_FONTS = &H14
Public Function GetSpecialFolderPath(SpecialFolder) As String
Dim oShlApp, oFolder, oFItem
Set oShlApp = CreateObject("Shell.Application")
Set oFolder = oShlApp.Namespace(SpecialFolder)
If Not oFolder Is Nothing Then
Set oFItem = oFolder.Self
GetSpecialFolderPath = oFItem.Path
End If
End Function
Using in this in Form
Option Explicit
Private FontFolder As String
Private Sub Command1_Click()
FontFolder = GetSpecialFolderPath(SFID_FONTS)
MsgBox FontFolder
End Sub
No comments:
Post a Comment