منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : التأكد من كون Microsoft Office موجودة على الجهاز أم لا
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
كاتب الموضوع : AhmedEssawy

في القسم العام :


كود :
Imports Microsoft.Win32
Public Enum MSApplications
WORD
ACCESS
EXCEL
End Enum
ثم الدالة :


كود :
Public Function isInstalled(ByVal App As MSApplications)
Dim strSubKey As String
Select Case App
Case MSApplications.ACCESS
strSubKey = "Access.Application"

Case MSApplications.EXCEL
strSubKey = "Excel.Application"

Case MSApplications.WORD
strSubKey = "Word.Application"
End Select
Dim objKey As RegistryKey = Registry.ClassesRoot
Dim objSubKey As RegistryKey = objKey.OpenSubKey("Word.Application")
Return Not objSubKey Is Nothing
objKey.Close()
End Function