Forum Moderators: not2easy

Message Too Old, No Replies

Linking a css file to a Word doc

         

praxie

5:24 am on Sep 27, 2006 (gmt 0)

10+ Year Member



hi,
I want to link a css file to a microsoft word document. Can some one please help me out here, telling how i can get all the styles defined in the css file in the word document.
thanks.

DrDoc

5:35 am on Sep 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld! [WebmasterWorld.com]

Err ... Not sure if I understand you correctly here. You want to use a stylesheet to control the styling of a regular Word document?

Setek

5:50 am on Sep 27, 2006 (gmt 0)

10+ Year Member



You -possibly- could do it :)

I reckon... start a html page with all the CSS inline, then "edit in Word" and it should import all the styles in...

One wonders why you would want to do this :)

There's a Style Editor in Word too - so if you can't import them, you could always just create them from scratch - but Word and styles are mostly to do with font size, face, alignment, etc.

So... even if it did import it, I would assume a couple of things:

1. It's Microsoft, it'll probably import it incorrectly; and
2. It's a word processor, not a web browser, so I wouldn't expect what gets imported to be brilliant.

praxie

5:55 am on Sep 27, 2006 (gmt 0)

10+ Year Member



Thanks DrDoc for getting back on that so fast :)
yea i want to control the text styles in the word documet using the styles that i have defined in the css file. My css files looks something like this:-
.B-HeadTitleChar{
fontFamily: Myriad Pro;
fontSize: 45px;
color: #9BDAFD;
fontWeight:bold;
}
.B-HeadTitleItalic{
fontFamily: Myriad Pro;
fontSize: 45px;
color: #9BDAFD;
font-style: italic;
fontWeight:bold;
}
these are just a few of the styles defined in the style sheet. One way which i was suggested was to link the css file using the "Templates and Add In" function in the "Tools" tab in microsoft word. This helps me to a certain extent. I can see some of the styles defined in the style sheet in the word document if i use this method. But i want that all the styles defined in the css file to appear in the word document, when i click on the "Styles and Formatting" button in the "Format" tab.
Appearing of some styles and some not is confusing me, or is there any other way of doing it?
Thanks.

praxie

6:06 am on Sep 27, 2006 (gmt 0)

10+ Year Member



hi setek,

yea that's a good question, y i want to do that? i have a application which imports a html file and displays it in the form of slides, with the same formatting which has been applied to the text in the word document. And there are more than 50 styles which i would be requiring, and creating them each time in the Style Editor in the word doc willl not be a good way to do it..
i have thus defined these styles in the css file. But iam unable to get the styles in the word doc. using the "Templates and Add In" function in the "Tools" tab helps me in linking word doc to the css file, but when i check for the styles, it shows me just a few of the styles defined in the css file and not all...
is there something wrong that im doing?