Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2017, 06:22 AM
lvalx lvalx is offline Macro to autoformat Numbered Headings Windows 10 Macro to autoformat Numbered Headings Office 2010 64bit
Novice
Macro to autoformat Numbered Headings
 
Join Date: May 2017
Posts: 3
lvalx is on a distinguished road
Default Macro to autoformat Numbered Headings

Hello,

I have a macro that finds sentences with keywords and lists the paragraph or section heading that they are under, for example, the macro currently retrieves shall statements and if the document were structured as below:



Section 3.3.1
The contractor shall do this

Would ideally return the 3.3.1 as well as the sentence containing the shall statement. However, I have encountered issues with documents that have headers and sections numbered manually. This mostly occurs when converting a .pdf document to .doc. I have looked at two versions of the same document, one .doc one .pdf and the formatting on numbered sections is completely lost with.pdf conversion.

I am looking for a macro that will find all the "hand jammed" section numbers and reformat them so that they will work with my other macro.

V/r,
Logan Valentine
Reply With Quote
  #2  
Old 05-08-2017, 08:50 PM
gmayor's Avatar
gmayor gmayor is offline Macro to autoformat Numbered Headings Windows 10 Macro to autoformat Numbered Headings Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What you ask is impossible without access to the converted document and an original document with the correct numbered formatting.

In a document with autonumbering, the numbering is probably applied by a multilevel list in conjunction with formatted heading styles (though the numbers could be formatted using fields).

When you convert the document to PDF, it becomes a graphical representation of that document - essentially a print-out. Such a PDF document does not have auto-numbered styles.

When converted to Word a PDF is but a weak facsimile of the original document and the sutonumbering replaced by plain text, as you have discovered.

At the very least the numbering must be complete, and the heading styles from the intended document or its template must be added to the converted document. Then you can search for the number sequences in order i.e. starting with Heading 1, remove the numbered text - in your example Section 3.3.1 - and apply the appropriate numbered style, which would replace that with the appropriate auto-number according to the style.

The scope for error is huge.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to autoformat Numbered Headings Capturing numbered headings jbvalen Word VBA 5 05-04-2017 05:03 PM
Numbered headings not working as expected after customising headings seanspotatobusiness Word 5 03-03-2017 04:44 AM
Word Mixing Numbered Headings with Numbered List Tess0 Word 11 07-15-2014 05:25 AM
Autoformat postformatting levelled headings bolpom Word 4 03-18-2011 12:52 AM
Macro to autoformat Numbered Headings numbered headings Caroline Word 5 03-14-2011 09:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:13 AM.


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