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 / Publisher / Programming / January 2008

Tip: Looking for answers? Try searching our database.

How to change Normal TextStyle with VBA?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ian - 01 Jan 2008 20:51 GMT
I am using Publisher 2007 with Vista.  As part of a macro, I wish to change
the font associated with the Normal style for a document.  The following code
(copied from reference manual) runs but does not do anything.

With ActiveDocument.TextStyles("Normal").Font
   .Name = "Tahoma"
   .Italic = True
   .Size = 15
End With

Does anybody understand why?
Ed Bennett - 02 Jan 2008 02:18 GMT
> With ActiveDocument.TextStyles("Normal").Font

For some reason, you have to do it like this:

Dim aFont As Font
Set aFont = ActiveDocument.TextStyles("Normal").Font
With aFont
    .Name = "Tahoma"
    .Italic = True
    .Size = 15
End With
ActiveDocument.TextStyles("Normal").Font = aFont

Signature

Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org


Rate this thread:






 
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.