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

Tip: Looking for answers? Try searching our database.

Changing a style in header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sol Apache - 23 Aug 2005 21:34 GMT
Hello

I have a macro which places text from a userform into various parts of a
document and (amazingly) it works except for one line which is to change the
style of a paragraph in the primary header of Section 2. This part works:

.Headers(wdHeaderFooterFirstPage).Range.Text = TxtReportTitle
  .Headers(wdHeaderFooterPrimary).Range.Text = TxtReportTitle + Chr(13) +
"Table of Contents (continued)"

But this line doesn¹t:
  'Selection.Style ActiveDocument.Styles("TOC continued")

All I want to do is change the Chr(13) and the next line into the
abovementioned style. I have tried changing ³Selection² to ³Range² but that
doesn¹t work either.

Can someone help me with the correct VB syntax for this?

Also, I¹d like to add a manual line break (^l) into my macro but I don¹t
know what the CHR code for that is. I understand that chr(13) is for
paragraph breaks (^p).

Thanks for any help.
Jezebel - 23 Aug 2005 21:59 GMT
.Headers(wdHeaderFooterFirstPage).Range.Paragraphs(2).Style = "TOC
continued"

> Hello
>
[quoted text clipped - 22 lines]
>
> Thanks for any help.
Sol Apache - 24 Aug 2005 00:30 GMT
Thank you very much, this works!

On 23/8/05 21:59, in article uy8bYWCqFHA.3520@tk2msftngp13.phx.gbl,

> .Headers(wdHeaderFooterFirstPage).Range.Paragraphs(2).Style = "TOC
>
[quoted text clipped - 26 lines]
>>
>> Thanks for any help.
 
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.