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 / January 2005

Tip: Looking for answers? Try searching our database.

How to select Style in Macro for Normal.dot

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ted - 18 Jan 2005 23:25 GMT
Would some tell me how to create a macro in Normal.dot for selecting a
Heading 1 for a Table of Contents.  I can select style "Heading 1" manually
which reads into Table of Contents fine.  However in a macro it fails at line
listed here.

ActiveDocument.Styles("Heading 1 Char").LinkStyle = "Heading 1"
Selection.Style = ActiveDocument.Styles("Heading 1 Char")

The macro is throwing Char at the end of Heading 1.  If you remove Char it
still fails at
ActiveDocument.Styles("Heading 1").LinkStyle = "Heading 1"

Ted
Jezebel - 19 Jan 2005 01:46 GMT
LinkStyle is part of the style definition. It's not part of setting the
style for something in the document. To do that, you set the Style property
of the paragraph, range, selection etc --

ActiveDocument.Paragraphs(1).Style = "Heading 1"
Selection.Style = "Heading 1"

> Would some tell me how to create a macro in Normal.dot for selecting a
> Heading 1 for a Table of Contents.  I can select style "Heading 1" manually
[quoted text clipped - 9 lines]
>
> Ted

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.