?

Log in

No account? Create an account
astolat

October 2017

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    
Powered by LiveJournal.com
astolat

Fanfic-conversion macros

This is a casual but useful set of Microsoft Word macros for converting doc files into clean HTML files (as opposed to the awful bloated versions created by Word's "Save As HTML") or into plain text files ready to paste into an LJ post or upload to an Automated Archive style archive (ie, with formatting tags but not paragraph breaks).

FanficMacros.zip (right-click save, look at the README file)

README

Totally not guaranteed, warranted, or anything else. If it blows up your computer, not my fault. *g*

by astolat on livejournal.com

Quick summary:

FanficWordMacros.txt
This is a file full of Microsoft Word macros. It will work in Word 2003 and 2007 under Windows, Word 2004 under Mac. It will NOT work in Word 97 for Windows or Word X for Mac. Sorry!

Here's how you install:
  1. Open Word

  2. Go to View Macros
    Word 2003 for Windows: Tools menu, Macros..., View Macros
    Word 2004 for Mac: Tools menu, Macros..., Macros
    Word 2007 for Windows: View menu, Macros..., View Macros

  3. If you already have a macro, select it and choose "Edit"; otherwise, put in some random macro name in the text box at the top and choose "Create". (You will be deleting this random macro in a second.)

    This will open up Visual Basic.

  4. In Visual Basic, if you have created a random macro and the file is otherwise empty, select the whole thing and delete it to make the file empty. Otherwise, just put your cursor on a new line at the very bottom of the file, after all of your other macros.

  5. Open up "FanficWordMacros.txt" (in Word or in a text editor, doesn't matter). Copy the entire contents of the document.

  6. Go back to VisualBasic and paste in the entire contents of FanficWordMacros.txt.

  7. Save and close VisualBasic. You should now have a whole bunch of macros in your Macros menu.

  8. Now open FanficMacroTesting.doc. It has instructions at the top for how to use the macros. Run the macros ConvertToHTML and ConvertToLJ on this file to test that the conversion is all working fine.



You don't need the rest of this -- the above will convert your doc files just fine, and then you can upload them anywhere you want and link. It's more for anyone who is curious about how I then go on to use this to instantly update my website.

index.cgi
This script is my index page on my fanfic website. It automatically updates the listing any time I drop in a story converted to HTML using the the "STORYINFO" chunk that gets stuck in at the top by the above macros. IE, I never actually touch my index, I just convert the story and bang it in. As you can imagine, this makes updating a lot easier.

Unfortunately, I didn't really write it to be shared, so it's only tossed in here as a basis for experimentation, but I hope it's not too hard to understand if you poke at it a bit. If you go look at

http://www.intimations.org/fanfic/

and see how my index works, it should hopefully make a lot of the script clear. Basically, you have index.cgi sitting in one directory, then you have one subdirectory for every fandom, and you drop your stories into those subdirectories.


cgi-lib.pl
This is just an old standard perl library that needs to be in the same directory as index.cgi for that to work.



Alas, I can't support or help if you run into trouble, sorry! Feel free to muck with it any way you want. Many thanks to nestra, balefully, setissma, and tahariel for helping me out with the testing!


eta: there is now an updated version of these macros for OpenOffice.
Tags: ,

Comments

Page 1 of 3
<<[1] [2] [3] >>
Oh. My. GOD, I needed this years ago (*snivelling piteously*). You would not believe the hours and hours I have spent hand-stripping all the thrice-damned eternally-hateworthy MS-spawned crap-coding out stuff, back when I knew no better than to idiotically click "save as HTML" in Word.
And, um, because I forgot to say this in the midst of all my snivelling -- THANK YOU. You ROCK, mightily and righteously.
Oh, BLESS YOU.
Wow, this is incredibly, headache-reducingly cool. Thank you thank you THANK YOU.
*\o/* YAY.
Thank you for this!
THANK YOU.
This is truly awesome, and I hope I am not too brain-dead to figure out how to make it work. :D Thanks muchly!
Oh, fantastic! Thank you!
Yay. Awesome. Thanks!
That's amazing. Thank you so, so much.
Any idea if this works with OpenOffice? I guess I will find out!
Huh, I have no idea. I would've said not a chance in hell, but googling shows that OpenOffice does actually have some kind of VisualBasic thing in it, so maybe? I suspect that the search-replace stuff is too specific, unless they've gone out of their way to match Microsoft's terms.
Thank you.
woohoo! Rock on, thanks.
Oh, that's *lovely*. I've been making do with converting and then creavite use of find/replace, but this is just so much nicer.
Go you!

Page 1 of 3
<<[1] [2] [3] >>