#1   Report Post  
ArtZ ArtZ is offline
Junior Member
 
Posts: 0
Default 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.
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

Last edited by ArtZ : June 8th 13 at 02:02 AM Reason: Hit submit instead of preview by mistake
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Direct Formatting vs. Character Formatting e125 Page Layout 4 December 31st 08 01:38 AM
Styles and Formatting-Select All removes formatting? Paul Moloney Formatting Long Documents 2 January 11th 08 04:39 PM
Add Reveal Formatting and Styles & Formatting to Format toolbar Nitaj Microsoft Word Help 7 October 19th 06 05:00 PM
Formatting In Use (Style and Formatting Task Pane) Slow + Incorrect? Paul Formatting Long Documents 6 November 8th 05 10:36 PM
Stopping automatic bullet formatting when formatting is turned off SolcorpianWriter Microsoft Word Help 2 December 23rd 04 06:25 AM


All times are GMT +1. The time now is 10:39 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"