Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Macro to change fonts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
maperalia - 02 Nov 2005 01:39 GMT
Can somebody help me to get a macro to update fonts in words:
1.- From page 1 to page 3 "Times NewRoman size 12"
2.- From page 4 to the end "Arial size 8"

Thanks.
Maperalia
Tony Jollans - 02 Nov 2005 01:54 GMT
Well, the blunt approach is to select pages 1 to 3 and Format > Font  and
select TNR, 12 ... and then to select page 4 on and go to Format > Font and
select  Arial, 8

But if you are using styles well there may be a better way.

--
Enjoy,
Tony

> Can somebody help me to get a macro to update fonts in words:
> 1.- From page 1 to page 3 "Times NewRoman size 12"
> 2.- From page 4 to the end "Arial size 8"
>
> Thanks.
> Maperalia
maperalia - 02 Nov 2005 07:21 GMT
Tony;
Thanks for your quick response.
I have a macro that "Change Sources" and "Update Links" into the word file
from an excel file. Usually the links's font gotten into the word file change
by themself to any font so I have to adjust them manually.
Therefore, I want to add a statement in the program to do it automatically.
I wanted to record the macro but did not let me select the fonts by pages.
Just allow me to do it select all.

Do you think you vcan help me with this matter?

Thanks in advance.
Maperalia.

> Well, the blunt approach is to select pages 1 to 3 and Format > Font  and
> select TNR, 12 ... and then to select page 4 on and go to Format > Font and
[quoted text clipped - 12 lines]
> > Thanks.
> > Maperalia
Tony Jollans - 02 Nov 2005 11:33 GMT
Yes, selecting by page is awkward but this will do it - and something pretty
similar could have been recorded -

ActiveDocument.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=4
With Selection
   .HomeKey Unit:=wdStory, Extend:=wdExtend
   .Font.Name = "Times New Roman"
   .Font.Size = 12
   .Collapse wdCollapseEnd
   .EndKey Unit:=wdStory, Extend:=wdExtend
   .Font.Name = "Arial"
   .Font.Size = 8
End With

One point to be aware of is that changes to the font can cause changes to
the pagination - the above code takes care of this by selecting the second
part from the end of the first selection.

--
Enjoy,
Tony

> Tony;
> Thanks for your quick response.
[quoted text clipped - 26 lines]
> > > Thanks.
> > > Maperalia
maperalia - 02 Nov 2005 16:34 GMT
Tony;
Thanks for the code. However, the program changes all pages to arial only.
Is there is any way to select from page 1 to 3 TNR size 12 and from page 4
to the end arial sieze 8

Best regards.
Maperalia

> Yes, selecting by page is awkward but this will do it - and something pretty
> similar could have been recorded -
[quoted text clipped - 52 lines]
> > > > Thanks.
> > > > Maperalia
Tony Jollans - 02 Nov 2005 18:12 GMT
Hi Maperalia,

It works for me, and I don't see how it could change the first three pages
to Arial. In your previous post you seemed to say that your were
experiencing random font changes which I don't understand either. It may be
that whatever causes the first problem also causes the second but I don't
know what it may be. Sorry.

--
Enjoy,
Tony

> Tony;
> Thanks for the code. However, the program changes all pages to arial only.
[quoted text clipped - 60 lines]
> > > > > Thanks.
> > > > > Maperalia
Graham Mayor - 03 Nov 2005 08:20 GMT
See if http://word.mvps.org/FAQs/Formatting/WholeDocumentReformatted.htm 
suggests a clue.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hi Maperalia,
>
[quoted text clipped - 65 lines]
>>>>>> Thanks.
>>>>>> Maperalia
maperalia - 03 Nov 2005 16:18 GMT
Thanks Tony for your help

Best regards
Maperalia

> Hi Maperalia,
>
[quoted text clipped - 78 lines]
> > > > > > Thanks.
> > > > > > Maperalia
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.