Skip to content

CommWebTeam/vba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VBA Macros

This repository is for various VBA macros.

MathML Macro

The MathML macro converts all equations into regular mathml text. It should be run on a word document before pasting into Dreamweaver.

To run the macro for the first time, you will have to add the MSForms library. You can do this with the following steps:

  1. If you do not already have the Developer tab in the Word toolbar, go to File -> Options -> Customize Ribbon and check "Developer" under Main Tabs.
  2. In the Developer tab, click "Visual Basic". This is where you run your macros.
  3. In the Visual Basic window, go to Tools -> References -> Browse, go to the System32 folder (type System32 into the address), and select the "FM20.DLL" file.
  4. Back in the References window, check Microsoft Forms 2.0 Object Library, which should be at the bottom of the list.
  5. Restart Word.

To run macros in general:

  1. When you open a Word file, immediately select "Enable Content".
  2. Open Visual Basic from the Developer tab.
  3. Go to Insert -> Module and paste the macro code in.
  4. Click the green "Run" button and select the macro you want to run.
    • If this doesn't work and you get an error message that says "DataObject:GetFromClipboard OpenClipboard Failed", then in the Visual Basic editor, click to the left of every line in the macro (a red dot should appear) and hold f5 to run through each line of the macro step-by-step in debug mode.

If these steps don't work, you may have to restart Word and retry.

After pasting into Dreamweaver, the angle brackets <> will be converted into html entities, so you will have to replace them manually using the following regex statements to convert them back into tags. Converting them into tags can also be done with the general dreamweaver formatting tool.

  1. Replace &lt;(/*math.*?)&gt; with <$1>
  2. Replace &lt;(/*m[ion].*?)&gt; with <$1>

Textbox Macro

The textbox macro (sourced from here) moves text out of textboxes and into the main document (in their original location), and then deletes the now-empty textboxes. This does not preserve any formatting in those textboxes, so it should only be used for Beyond Comparing.

Table Mover Macro

  1. Paste the document for which you want to have the tables removed

Capturedddd

  1. Ensure that Developer mode is enabled with design mode off. For further instructions please refer to this link (https://support.microsoft.com/en-us/office/show-the-developer-tab-in-word)

    Captureppp
  2. Click the "Move Tables to New Document" Button

Capturegggg

  1. New document should be created with only the tables from the document. Feel free to rename the new document to your liking!

About

Macros to be ran in Visual Basic to automate certain actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •