View Single Post
 
Old 04-24-2012, 09:23 PM
b0x4it b0x4it is offline Windows 7 32bit Office 2010 32bit
Advanced Beginner
 
Join Date: May 2011
Posts: 95
b0x4it is on a distinguished road
Default

thanks for your prompt reply
How about selecting the current paragraph and then running your code using the following code?

Code:
Sub MMD_MakeReferencesInParagToJustNumber()

    On Error Resume Next
    Dim oFld As Field
    Selection.GoTo what:=wdGoToBookmark, Name:="\sel"
    For Each oFld In Selection.Fields
        If oFld.Type = wdFieldRef Then
            'add charformat switch:
            If InStr(oFld.Code.Text, "\# 0;0") = 0 Then
                oFld.Code.Text = Replace(oFld.Code.Text, " \h", " \# 0;0 \h")
            End If
            'updates the field results to display the new format
            oFld.Update
        End If
    Next oFld

End Sub
Reply With Quote