'يمثل هذا المتغير برنامج الوورد
public WordApp As New Word.Application()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' يمثل هذا المتغير النص المكتوب
Dim DRange As Word.Range
Me.Text = "Starting Word ..."
'اضافة مستند جديد
WordApp.Documents.Add()
Me.Text = "Checking words..."
' تعرف النص المكتوب الحالي و الموجود في المستند الذي اضفناه
DRange = WordApp.ActiveDocument.Range
'ادخال النص المكتوب في مربع النص الى المستند
DRange.InsertAfter(TextBox1.Text)
'يمثل هذا المتغير الاخطاء الاملائية
Dim SpellCollection As Word.ProofreadingErrors
'تعريف الاخطاء الاملائية المكتوبة في النص
SpellCollection = DRange.SpellingErrors
'اذا كانت هناك اخطاء املائية في النص
If SpellCollection.Count > 0 Then
Dim iword As Integer
Dim newWord As String
' حلقة تكرارية تضيف جميع الاخطاء الاملائية الى اللستة
For iword = 1 To SpellCollection.Count
newWord = SpellCollection.Item(iword).Text
ListBox1.Items.Add(newWord)
Next
End If
Me.Text = "Word spelling Demo"
End Sub
Please SUBSCRIBE to get new articles directly into your Email inbox!
public WordApp As New Word.Application()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' يمثل هذا المتغير النص المكتوب
Dim DRange As Word.Range
Me.Text = "Starting Word ..."
'اضافة مستند جديد
WordApp.Documents.Add()
Me.Text = "Checking words..."
' تعرف النص المكتوب الحالي و الموجود في المستند الذي اضفناه
DRange = WordApp.ActiveDocument.Range
'ادخال النص المكتوب في مربع النص الى المستند
DRange.InsertAfter(TextBox1.Text)
'يمثل هذا المتغير الاخطاء الاملائية
Dim SpellCollection As Word.ProofreadingErrors
'تعريف الاخطاء الاملائية المكتوبة في النص
SpellCollection = DRange.SpellingErrors
'اذا كانت هناك اخطاء املائية في النص
If SpellCollection.Count > 0 Then
Dim iword As Integer
Dim newWord As String
' حلقة تكرارية تضيف جميع الاخطاء الاملائية الى اللستة
For iword = 1 To SpellCollection.Count
newWord = SpellCollection.Item(iword).Text
ListBox1.Items.Add(newWord)
Next
End If
Me.Text = "Word spelling Demo"
End Sub
Please SUBSCRIBE to get new articles directly into your Email inbox!
تعليقات
إرسال تعليق