Giter Site home page Giter Site logo

word-vba's Introduction

word-vba

This repository contains macros written in Word VBA. Mike Pope is the host.

There are two branches: master and word-vba-feature

Versions of Word

I use Word 2013 for Windows, but much of this applies to earlier versions of Word. Most of it probably applies to Word for the Mac, but I cannot guarantee that.

Installing macros

To install macros, you need to be able to open the macro editor in Microsoft Word. In Windows, you can do this by pressing Alt+F11 while you're in a document. If you've configured Word to show the Developer tab, you can also use the Code area of the ribbon to manage macros.

Here's a primer on how to use the VBA editing environment and work with macros:

Getting Started with VBA in Word 2010

List of macros

Here's a brief description of what's in this repo. The .mac extension is just a plain text file (like a .bas module).

Macro Description
change-plaintext-to-normal.mac Change plain text to Normal style. This was written in response to a query to on the Word-Pc list. If you open up a pure-text file in Word, Word formats the text in the file as the style named Plain Text. The poster wondered if there was a way to have Word instead show everythign in Normal. There might be a better way to do that, but this macro seems to do the trick. It relies on the fact that Word runs AutoNew, AutoOpen, and AutoClose macros if they exist when (respectively) you create, open, and close a document.
show-hide-revisions.mac > This macro toggles revision marks. In the language of the Word UI, it's the equivalent of the following: Review (tab) > Tracking > [All Markup|No Markup] More info: http://mikepope.com/blog/DisplayBlog.aspx?permalink=2407
toggle-smart-quotes.mac Turns on/off the feature in Word that converts straight quotes to curly quotes. Most useful when this has a keyboard shortcut assigned to it.
make-bold.mac Adds <b></b> tags around the selected text.
make-code.mac Adds <code></code> tags around the selected text.

Managing the Styles pane

Macro Description
set-styles-panel-to-all-alphabetical.mac Changes the display in the Styles pane to a) show all styles in b) alphabetical order.

HTML-related macros

Macro Description
convert-all-links.mac Walks through all Word hyperlinks and converts them to <a> elements (with target="_blank"). An interesting feature of this macro is that it walks backward through the collection of links. The issue is that as each hyperlink is converted, it stops being a hyperlink and is thus removed from the collection. This confuses any code that is walking the collection.
convert-to-ul-list.mac Converts the selected text to a <ul> list. Each paragraph becomes one list item.
hyperlinks.mac Contains functions to remove hyperlinks or unlink them (convert them to regular text).

word-vba's People

Contributors

mikepope avatar robws avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.