Convert Word to BBCode

stevenmilz

josh's date at akershus
When I write trip reports I usually write them in Word and cut-and-paste them into the forum. That doesn't bring formatting along though, just the text. Previously I'd go through the post and use the formatting buttons to add bold, underlining, italics, etc. However, with the SeaWorld trip report I just posted, I came across this webpage - https://www.phpbb.com/community/viewtopic.php?f=17&t=395554 - that provides a VBA macro that applies BBCode formatting to the Word document. You can then just cut-and-paste from Word into the forum and the formatting comes along.

Here's what I did to use it.
1. Cut-and-paste your "real" Word document into a blank document; you don't want to mess up the original one.
2. Click ALT-F11 to bring up the VBA editor.
3. Double click "ThisDocument" under the "Project" heading in the "Project" window at the top-left corner of the editor.
4. On the website, find the first code block and click the SELECT ALL link.
5. Right-click and select COPY from the context menu.
6. Go back to the VBA editor and paste the code into it.
7. Place your cursor into the "Word2BBCode" sub and press F5 to run the macro.
8. Your document should be BBCode formatted and ready for cut-and-paste.

I had problems with the "ConvertColor" subroutine; if you do, start the process over (your document already has BBCode formatting and you don't want double-formatting) and remove the line that says "ConvertColor" before pressing F5.
 

Micah008

New member
Cool, thanks. I had tried to do this for a table at some point in the past, and I just gave up... this would probably have worked better than what I tried to do on my own (with Excel actually).
 
Top