Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2014, 02:22 PM
Larry Sulky Larry Sulky is offline How to parse bold sections of a paragraph? Windows 7 64bit How to parse bold sections of a paragraph? Office 2010 64bit
Novice
 
Join Date: Mar 2014
Posts: 14
Larry Sulky is on a distinguished road
Default

You're on the right track. First find which paragraphs are wholly bold (or italic, or whatever), which ones are partially, and which ones are not. Then for the partial ones, use a similar kind of logic to discover which words are wholly, partially, or not bolded etc. Then for those partial ones, go down to the character leve. In every case, 0 means no, -1 means yes, and 9999999 means partial. You'll need to examine properties as shown on the debug.print statements below (fully expressed for clarity, but ugly):



Code:
Dim para As Integer
Dim word As Integer
Dim char As Integer

para = 3
word = 6
char = 5

Debug.Print ActiveDocument.Paragraphs.Item(para).Range.Bold
Debug.Print ActiveDocument.Paragraphs.Item(para).Range.Words.Item(word).Bold
Debug.Print ActiveDocument.Paragraphs.Item(para).Range.Words.Item(word).Characters(char).Bold
Obviously, you wouldn't just set specific values for the indexes para, word, and char; you would nested-loop through them (like your original sample shows for paragraphs).
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to parse bold sections of a paragraph? Not Bold text but it comes up bold Pluviophile Word 7 10-22-2013 10:29 AM
Format Bold in one line makes all lines bold Nitte Word 2 02-07-2013 12:34 AM
How to parse bold sections of a paragraph? Set paragraph text to bold. Sorcerer13 Word 1 09-04-2012 11:08 AM
Export Outlook emails to Access & parse certain text elements smahale Outlook 0 01-18-2012 09:30 PM
parse, store and email a .tmp file from wordpad? scadaman29325 Office 0 09-28-2010 04:56 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:08 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