Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Help with formatting
Hi,
I am new to the Forum and need some help to format certain sections of a Word document. This formatting is repetitive and takes a long time by hand since there are 10 pages in the document. Seems that some simple VBA should be able to to do this. In the sample document below, there is a date range which needs to be changed to a 14 font and bolded. Also I would like the first sentence of each paragraph bold and underlined. Below is an example of the document layout: Code:
MAY 23-29 Bay Area KidFest. Entertainment shows, face painting, balloon hats, games, inflatable bounces and crawls, KidArt, Monster Mural, Dora the Explorer and Diego, Kid's Town America, SportStars Field of Dreams, Radio Disney, sports games and rides. May 25-27. Mount Sarah Drain of Concord, Calif. and her daughter Catherine, 1, dance together to the music at the Walnut Creek Art and Wine Festival at Heather Farm Park in Walnut Creek Calif. Saturday June 6, 2009.(Dan Rosenstrauch/Staff) ( DAN ROSENSTRAUCH ) Diablo High School, 2450 Grant St., Concord. $5. 925-671-3287, www.KidFestConcord.com. Civil War Battles and Encampment. 32nd annual. Visit encampments of Union and Confederate soldiers and witness historic battles. Be advised that occasional loud cannon and gunfire may be heard as part of the re-enactment activities during the day. It is not advisable to bring dogs to this event. Contact the camp for schedules. May 25-27. $5-$29. Roaring Camp and Big Trees Railroad, 5355 Graham Hill Road, Felton. 831-335-4484, www.roaringcamp.com. Can anyone in the Forum help with VBA or another option to quickly format the entire document as described above? Any help is greatly appreciated. Thanks, Art Last edited by ArtZ : June 8th 13 at 02:02 AM Reason: Hit submit instead of preview by mistake |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Help with formatting
To add bold and underline to the first sentence of each paragraph, you
should be able to use code such as the following: Sub ApplyFormattingToFirstSentence() Dim p As Paragraph Dim s As Range For Each p In ActiveDocument.Paragraphs With p.Range.Sentences(1).Font ..Bold = True ..Underline = wdUnderlineSingle End With Next p End Sub See http://www.gmayor.com/installing_macro.htm for more. -- Stefan Blom Microsoft Word MVP "ArtZ" skrev i meddelandet ... Hi, I am new to the Forum and need some help to format certain sections of a Word document. This formatting is repetitive and takes a long time by hand since there are 10 pages in the document. Seems that some simple VBA should be able to to do this. In the sample document below, there is a date range which needs to be changed to a 14 font and bolded. Also I would like the first sentence of each paragraph bold and underlined. Below is an example of the document layout: Code: -------------------- MAY 23-29 Bay Area KidFest. Entertainment shows, face painting, balloon hats, games, inflatable bounces and crawls, KidArt, Monster Mural, Dora the Explorer and Diego, Kid's Town America, SportStars Field of Dreams, Radio Disney, sports games and rides. May 25-27. Mount Sarah Drain of Concord, Calif. and her daughter Catherine, 1, dance together to the music at the Walnut Creek Art and Wine Festival at Heather Farm Park in Walnut Creek Calif. Saturday June 6, 2009.(Dan Rosenstrauch/Staff) ( DAN ROSENSTRAUCH ) Diablo High School, 2450 Grant St., Concord. $5. 925-671-3287, www.KidFestConcord.com. Civil War Battles and Encampment. 32nd annual. Visit encampments of Union and Confederate soldiers and witness historic battles. Be advised that occasional loud cannon and gunfire may be heard as part of the re-enactment activities during the day. It is not advisable to bring dogs to this event. Contact the camp for schedules. May 25-27. $5-$29. Roaring Camp and Big Trees Railroad, 5355 Graham Hill Road, Felton. 831-335-4484, www.roaringcamp.com. -------------------- In this case, May-23-39 would be changed to bold and the font to 14. Bay Area KidFest. and Civil War Battles and Encampment. would be bold and underlined. Can anyone in the Forum help with VBA or another option to quickly format the entire document as described above? Any help is greatly appreciated. Thanks, Art -- ArtZ |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Direct Formatting vs. Character Formatting | Page Layout | |||
Styles and Formatting-Select All removes formatting? | Formatting Long Documents | |||
Add Reveal Formatting and Styles & Formatting to Format toolbar | Microsoft Word Help | |||
Formatting In Use (Style and Formatting Task Pane) Slow + Incorrect? | Formatting Long Documents | |||
Stopping automatic bullet formatting when formatting is turned off | Microsoft Word Help |