p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Word VBA (http://p2p.wrox.com/forumdisplay.php?f=231)
-   -   VBA CSS Creation (http://p2p.wrox.com/showthread.php?t=88640)

rangeshram October 22nd, 2012 06:45 AM

VBA CSS Creation
 
Hi,

We need to process the word document and generate CSS file which used for ePub creation. Please give your thoughts for the two methods used to generate CSS.

Method 1: Process through WordML (my colleague suggestion)

Method 2
: Read character by characer and based on the Word Object Model generate CSS .

For example: margin-top: 1em will be set based on Word paragraph space before

class1
{

font-size:100%;
margin-top:1em;
margin-bottom:0em;
border-bottom:5px solid #33339a;
margin-left:0em;
font-weight:normal;
text-align:left;
text-indent:0em;
}


Please tell about the pros and cons for the above two methods. And also specify which is the best and effective.

Note: We have also google and found that "http://www.oocities.org/w2css/" is helpful but can't able to download.

Thanks,
Ram

Shasur March 18th, 2013 12:54 PM

Hi Ram

If the WordML provides the necessary styles nothing like it. Reading character by character is not viable; instead you can loop through the styles that are available in the document (Heading 1, FootNote, Figure etc .. ) and then create a stylesheet from that..

Cheers
Shasur


All times are GMT -4. The time now is 09:59 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.