Consulting

Results 1 to 2 of 2

Thread: Reference Checking

  1. #1
    VBAX Regular
    Joined
    Dec 2017
    Posts
    11
    Location

    Reference Checking

    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

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Sadhik: you've already asked about an issue closely related to this in www.vbaexpress.com/forum/showthread.php?61637-Reference-in-Superscript

    As per the VBA Express Rules (http://www.vbaexpress.com/forum/faq...._new_faq_item3) kindly don't do that. Thread closed. You may continue the discussion in the original thread.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •