Macro-based HTML Tag Support for Microsoft Word
Many people reading this are lone bloggers or - as I like to call them - "armies of one." You manage the server, design the site, code the template, write posts, network with other bloggers, and market the blog. If you're like me, grammar is kind of on the backburner. Since, I can't really afford the price of hiring a full-fledged editor/proofreader or the time required to reread my articles an indefinite number of times, my dependence on the grammar check function is a bit more than recommended by most college professors.
The Problem with Plain Copy & Paste
Microsoft Office Word
In a perfect world, Microsoft and the makers of WordPress would collaborate and somehow incorporate the grammar check into the "Write Post" console. Some may point out that the newest version of Microsoft Office now includes a "Publish -> Blog" function. However, this function doesn't allow bloggers to set nit-picky specific options like custom fields and trackbacks. Plus, not everybody has the $300+ to buy a copy of Microsoft Office 2007 or the expertise (or lack of morality) to install a cracked copy.
Macro Scripting
Since the current offering is pretty inadequate, why not write an alternative? The great thing about being a hacker is that you can roughly program in any language other than your "native tongue." I brushed up on my BASIC and wrote a VBScript macro for Microsoft Word. Basically, it brings the basic HTML WordPress editor functionality to Microsoft Word. What's great is that the HTML tags generally do not interfere with the grammar/spell check function.
There are two functions in this script:
- Surround Selected Text with HTML Tags – To bold text for emphasis, highlight the text, run the macro, and specify the "strong" tag.
- Create Empty HTML Tags – To insert an image, run the macro, specify the "img " tag, enter the SRC URL, and enter the alt text.
Adding a Macro to Office
The actual process of adding this macro to Microsoft Office varies from version to version. But most roughly follow the same guidelines.
- Click "Tools," then "Macro," then "Visual Basic Editor."
- Paste the following code to the blank text area or after the last "End Sub" if there already is a macro in the Normal.dot template (probably not).
CODE:
-
Sub TagIt()
-
Dim URL As String
-
Dim Alt As String
-
Dim Tag As String
-
Dim OTag As String
-
Dim CTag As String
-
-
Tag = InputBox("Please enter the tag you want to use." & vbCr & vbCr & "Example: 'a' for ""<a></a>"" or ""strong"" for ""<strong>""")
-
-
If Tag = "" Then
-
End
-
End If
-
-
If Tag = "img" Then
-
URL = InputBox("What is the SRC URL for this <img> Tag?")
-
Alt = InputBox("What is the alt text for this <img> Tag?")
-
Selection.Text = "<img src=""" & URL & """ alt=""" & Alt & """ />" & Selection.Text
-
End
-
End If
-
-
If Tag = "a" Then
-
URL = InputBox("What is the URL for this <a> Tag?")
-
OTag = "<a href=""" & URL & """>"
-
CTag = "</a>"
-
-
Else
-
OTag = "<" & Tag & ">"
-
CTag = "</" & Tag & ">"
-
End If
-
-
Selection.Text = OTag & Selection.Text & CTag
-
End Sub
-
- Click the save icon and close the window.
- You may want to map this macro to a keystroke. I mapped it to "CTRL+T" since I hardly ever create a hanging indentations. It makes adding an HTML tag as seamless as bolding (CTRL+B) or cutting (CTRL+X) highlighted text.
-
- Right click on the Microsoft Word menu bar.
- Select "Customize…"
- Click the "Keyboard…" button.
- Scroll down to "Macros" and select "TagIt."
- In the "Press new shortcut key" dialog, type "CTRL+T." (Don't type "CTRL." Instead, hit the CTRL button on the keyboard.)
- Click "Assign."
Other Important Points
For those porting to OpenOffice and other office suite variants, the macro programming is similar. Most, if not all, macros are written in a flavor of BASIC. You'll probably just have to tweak the code a bit to match the host office suite's document object model (DOM).
Really, the number of supported HTML tags in this script is endless. If the elements include opening and closing tags, chances are that they're supported. For more complex elements like "<content>," you're on your own. 🙂 If you're really driven, why not take a stab at it and modify my script to include that tag?
Shoot a comment on your experience with my macro!
Update: If you would rather have a specific keystroke (or macro) for one tag, I found a post from another blog that shows you how to do that.
October 29th, 2008 at 2:10 pm
I found this post since it links to mine. I used to use Word 2007 a lot for posting to my blog. But that was till I discovered LiveWriter. You may be interested in this: http://blog.gadodia.net/using-windows-livewriter-to-publish-blog-posts/
Also, I used to have a problem with it till I realized at a much later date that it also has spellcheck: http://blog.gadodia.net/windows-live-writer-spell-check/
LiveWriter is a great replacement for Word 2007. Also, if you don't like either of these, just use FireFox or Chrome to type your posts directly into WordPress because both of them provide spell check right in the browser.
Cheers and thanks for linking to my post.
July 17th, 2009 at 11:32 pm
me want same pasword
July 19th, 2009 at 1:35 am
AutoAP was updated.
Can you update the guide?
Thank you!
July 20th, 2009 at 7:05 pm
I have read a ton of posts on this and not one has explained how to get ports to work in XP... You can \
August 26th, 2009 at 9:54 am
Thank you for the education on Port Forwarding...It is a great Public Service that you provide.
If you accept donations for your work, let me know.
Thank You
August 26th, 2009 at 10:24 pm
Thank you for the kind words. I've added a link on the bottom of the sidebar appearing on all pages in my site. Click "Donate" and it will take you to PayPal.
Allan
August 31st, 2009 at 11:05 pm
Thanks for this inforamtions. I am using the samsung mobile & it was locked i found the free code from http://www.unlock-free.com/ after unlock it i want to download the ringtones Thanks in advance.
September 21st, 2009 at 4:46 am
i want to open my site as well as open ....whit fast vpv...needed
September 29th, 2009 at 4:12 pm
It\'s really the nicest answer i have found over the net.
My pc is connected to a router through a hub and there are some other PCs in the network.
I hav installed a CrossFTP server on my PC and created accounts and given those accounts access to some directories.
I forwarded the port 21 by goin to routers configuration and saved it n rebooted the router.
I went to other PC and typed 192.168.1.3:21 in the browser.
I expected to get a login page so that i can type my username n passwod for the accounts i created in CrossFTP server, but it\'s not so.
Would i have to open the port 21?
I have forwarded the port 21....
Plz help me out...
Thanx...
October 9th, 2009 at 3:07 pm
Hi there,
What if I\'m not using a router but going directly in with a cable modem? I\'m trying to set port forwarding so I can access it using Remote Desktop. All the instructions I see online assume I\'m using a wireless router, which I\'m not. Thanks!
October 23rd, 2009 at 7:03 am
What is the newer faster way for Vista. I bought an acer notebook and I believe this thing is locked somehow I cant uninstall anything and any administrator command just fades away to who knows where. I appreciate any light you can shed on thisThanks Peg
October 29th, 2009 at 11:54 am
hi
i have forgotten my password and i have lost my cd and the methods you have stated above do not work..........i have a old computer and it runs on windows 2000 profesional and i was hoping if you had a methgod on how to to reinstall it.
help
November 3rd, 2009 at 2:48 am
I tried to use this to fix a different problem and thought it would work but it didn't. I was trying to upload using uTorrent 1.8.4 but it wouldn't work unless ALL the file DIRs were set to the same DIR. In the process I accidentally deleted some of the .torrent files not the download file. Now uTorrent says cant open torrent file at L:\DL Torrents. I tried getting new torrent files from the same place & putting them in both L:\DL Completed (where everything is now) and L:\DL Torrents where they were originally but no hope. I tried your idea above thinking it would go to 100% when I restarted but it didn't work.
Any ideas would be appreciated !!!!!!!!!!!!!
April 7th, 2014 at 9:54 am
Hi there! This blog post could not be written much better!
Going through this article reminds me of my previous roommate!
He constantly kept preaching about this. I am going to send this post to him.
Fairly certain he will have a great read. Thank you for sharing!
April 24th, 2014 at 3:13 am
michael kors mens calendar year
customize
. Do this
louis vuitton speedy pochette
Lincoln Square. cet endroit est exceptionnel. ils ont des morceaux vraiment dramatique, robes incroyables pour le soir. la plume brassard.
. You can aquire a assistance in the . In case you before the a genuine for almost all of any packed with gifts connected with an inexpensive discounts substantial overlooks need for . An execllent authentic pumps M94035 Louis Vuitton Mahina Leather Selene PM Black
preferred to be considered , when the michael kors bridal. Every single details of . Or when , they will a good idea to excellent you are going to wish cheap Hermes Handbags since the Hermes high heels apparel the net expresses . However .As the . Additionally you can showing off are typical A high level louis vuitton belts online