PDA

View Full Version : Reference Checking



Sadhik
12-28-2017, 03:33 AM
Hi,

I am working in the word file which contains lot of reference numbers in superscript. I iterate through every reference number and check any reference number is missing. I have the problem with my following code. Please advise me.

Sub Superscription()
Dim opara As Paragraph
Dim x As Integer
Dim count As Integer
Dim i As Integer
Dim DocumentContent As Range
Set DocumentContent = ThisDocument.Content
With DocumentContent.Find
.Font.Superscript = True
.Format = True
.Forward = True
Do While .Execute
If .Found = True Then
x = DocumentContent.Text
End If
Loop
MsgBox " Total Number of Referemces is " & x
End With
For i = 1 To x
For Each opara In ActiveDocument.Paragraphs
If opara.Range.Text <> i Then
MsgBox i & " Not Found"
End If
Next
Next i
End Sub

Regards,
Sadhik

macropod
12-28-2017, 03:50 AM
Sadhik: you've already asked about an issue closely related to this in www.vbaexpress.com/forum/showthread.php?61637-Reference-in-Superscript (http://www.vbaexpress.com/forum/showthread.php?61637-Reference-in-Superscript)

As per the VBA Express Rules (http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3) kindly don't do that. Thread closed. You may continue the discussion in the original thread.