foolish_m0rtal: (Default)
[personal profile] foolish_m0rtal
So I just got out of a conversation with NF-kun about how much of a pain it is to hand code HTML when you're posting stories on Livejournal. She mentioned that there might be a way to get around this, and after doing twenty minutes of digging, I've got your solution.

Earlier than Office 2007:

1) Save the document as an HTML file (it should be in the file formats in the drop down menu in your Save File As dialogue box)

2) Open up the document in Word

3) Go to View->HTML source

You're almost done! See Important Note at the bottom.

Office 2007 (Bane of my existence)

Okay, this is slightly more tricky, since apparently Microsoft has taken away the functionality to easily view HTML sources in Word. I think they're trying to get users to use another piece of new software for this. That's just tempting me to find a way around it...
I just did these steps for one of my really long stories, and it worked beautifully.

1)Open Word. Save the document as a filtered HTML webpage, NOT a regular HTML webpage, this is bad (it should be in the file formats in the drop down menu in your Save File As dialogue box)

2) Open up the document in Word. Click the round Office button on the far left. For those of you who didn't know this was a button, worlds have just opened up.

3) Go down to the very bottom to the right, where there are two buttons: Word Options and Exit Word. Select Word Options.
4) Click Advanced in the right hand menu.

5) Scroll down to General

6) Check the box that says 'Confirm file format conversion on open.' Word will remember this setting for later projects, so you will only need to set Word Options the very first time you go through these instructions.

7) When you open up the file, a dialogue box is going to come up asking what you want it to open the document as. Select Plain Text. This dialogue box only comes up when you open up an .htm/html document and does not interfere with your .doc and .docx files.

You're almost done! See Important Note.

Important Note: Most of the people that post stories know that pasting a Word document directly into a post is bad times in terms of entry length. Heck, this is why you people are pasting HTML into the entry in the first place! So...

After looking at this Plain Text code, you can see why LJ throws a fit. There's a LOT of unnecessary XHTML text. Paste this code into dear old Notepad and start editing.

Ironically, I had to write this part of the post in HTML because copying and pasting from the Word document into the Rich Text box took up too much code, and it was throwing the Entry Too Large warning. *rolls eyes* I had to encase all my code in quotation marks.

After you clean up your code by following the instructions below, remember to check the Disable Auto-Formatting box in your HTML tab when you're pasting in your HTML text.

Here's what you should get rid of:

1) All of this shit at the top that starts with "<html>" and ends with "<div class= Section 1>"

You should now only see "<p class=MsoNormal>"and then where your text starts.

2) Hit the Replace All option and replace:

"<p class=MsoNormal>"
WITH
"</br><p>"
(I put the "</br>" in so that it will split up your text into pretty paragraphs. Remember Disabling Auto-Formatting? It prevents erratic line breaks that happen because of Notepad, but also prevents LJ from breaking up your text the way you had it formatted in Word)

"<span lang=EN-GB>"
WITH
a blank space, meaning don't enter any text into the Replace With text box in your Replace dialogue box

"</span>"
WITH
a blank space, same as above

3) Get rid of this code at the bottom:

"</div>

</body>

</html>"
 

And that's it for you. So here's a (relatively) less painful way to convert your Word documents into HTML files for your LJ! Earlier Office users, it takes a few seconds. Office 2007 users...it takes a little longer, but still cuts your time significantly!
(deleted comment)

Date: 2009-10-28 04:44 pm (UTC)
From: [identity profile] foolish-m0rtal.livejournal.com
terrific! So glad I could help!

Did you use the old Word instructions or the 2007 Word instructions? Just so I can verify that my old Word instructions work too.
(deleted comment)

Date: 2009-10-29 02:07 am (UTC)

Profile

foolish_m0rtal: (Default)
foolish_m0rtal

January 2023

S M T W T F S
1 234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 13th, 2026 01:49 pm
Powered by Dreamwidth Studios