Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-24-2012, 07:39 PM
b0x4it b0x4it is offline Change all fields to just numbers in current page! Windows 7 32bit Change all fields to just numbers in current page! Office 2010 32bit
Advanced Beginner
Change all fields to just numbers in current page!
 
Join Date: May 2011
Posts: 95
b0x4it is on a distinguished road
Default Change all fields to just numbers in current page!

I have been using this code for a log time to convert all the fields of the document to just numbers:

Code:
Sub MMD_MakeAllReferencesToJustNumber()
    On Error Resume Next
    Dim oStoryRng As Range
    Dim oFld As Field
    For Each oStoryRng In ActiveDocument.StoryRanges
        For Each oFld In oStoryRng.Fields
            If oFld.Type = wdFieldRef Then
                If InStr(oFld.Code.Text, "\# 0;0") = 0 Then
                 oFld.Code.Text = Replace(oFld.Code.Text, " \h", " \# 0;0 \h")
                End If
             oFld.Update
            End If
        Next oFld
    Next oStoryRng
End Sub
but if the document is a long one with lots of field, then it takes long time to process all fields every time I run this code, because it updates all fields in the current document.

Now, I am wondering if it is possible to just update all the fields in the current page by changing

Code:
For Each oStoryRng In ActiveDocument.StoryRanges
to something just for the current page. I appreciate your help in this matter.
Thanks,
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save the current page in a new file with all the page settings (header, footer Jamal NUMAN Word 6 03-15-2012 03:27 PM
Change all fields to just numbers in current page! Page Numbers Not Matching Chapter Numbers gracie5290 Word 1 02-02-2012 11:41 PM
Change all fields to just numbers in current page! How to call current PC date and/or current PC year KIM SOLIS Excel 2 11-04-2011 06:09 PM
Change all fields to just numbers in current page! Auto insert current month's name and current year Styler001 Word 4 01-25-2010 06:40 PM
Change all fields to just numbers in current page! Page numbers...starting on page 3 Motiv8td1 Word 2 02-21-2009 07:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft