اذهب الي المحتوي
أوفيسنا

اختبار وجود مرجع محدد ثم اضافته اذا لم يكن موجود


الردود الموصى بها

هذا الكود للتأكد من وجود مرجع

Microsoft Word 11 object library

و اذا لم يكن موجود يتم اضافته بالكود

Dim Ref As Reference, mypath As String, myreffound As Boolean

myreffound = False
For Each Ref In References
   If Ref.Name = "WORD" Then
   myreffound = True
   End If
Next

If myreffound = False Then
        mypath = "C:\Program Files\Microsoft Office\OFFICE11\MSWORD.OLB"
       Set Ref = References.AddFromFile(mypath)
End If

مع ملاحظة انه طبعا يمكن الاضافة من ملف موجود فى اي مسار

موضوع مرتبط

كيفية نقل المراجع بالكود و اضافتها ثانية,

http://www.officena.net/ib/index.php?showtopic=1885

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information