Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Mar 2004
    Location
    Peru
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word versions for macro writing

    I have been using Office 2003 Word for years and still do basically because I have written lots of macros that I frequently use. When Word 2007 came out I saw that it was not macro-friendly so didn't upgrade (writing them was not a problem, but you couldn't add them to the ribbon). I have not bothered checking it out for the newer versions. But late last year I got my wife a new computer and moved her copy of Word 2003 to that computer and found that it was not longer supported and wouldn't even update with whatever updates existed with MS (I manually searched and downloaded what I could find and manually installed them, but doubt that I have them all). So now I'm wondering if I should seriously consider getting a newer version of Word for safety sake, but I'd want to be able to move my macros over and continue to write them and make them available on a toolbar. Will I be able to do that with newer versions?

  2. #2
    New Lounger
    Join Date
    Mar 2016
    Location
    Alfreton
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Surely all your macros work when you upgrade from one version of Word to another, after all its just VBA? Isn't your problem that you can;t add them to the ribbon any more. Can't you assign them short cut keys?

  3. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Sati,

    You have a couple of ways to accomplish your task.

    1. You can use Alt+F8 to get a list of the available macros.
    2. You can assign shortcut keys as kxsport suggested.
    3. You can setup a custom menu which will show up on the Add-ins tab.


    To accomplish #3 do the following:
    1. Right click on the ribbon and select Customize the Ribbon...
    2. Check the Add-ins under Main Tabs on the right. I like to also move it up to be the first item.
    3. In VBA create the menu using the code below.
    4. Setup an AutoExec macro to call the menu code so it happens each time you start Word.


    Sample Menu Code: {Place in Normal to be available to all Documents}
    Code:
    Option Explicit
    
    '                         +-------------------------+             +----------+
    '-------------------------|     MyMacrosMenu()      |-------------| 03/24/16 |
    '                         +-------------------------+             +----------+
    'Called by: Auto_Open
    
    Sub ApplicationMenu()
    
       Dim myMenuBar As Object
       Dim newMenu   As Object
       Dim ctrl      As Object
       
       KillApplicationMenu "Macros Menu"  'Deletes menu bar if it exists before recreating
       
       Set myMenuBar = _
          CommandBars.Add("Macros Menu", msoBarLeft + msoBarTop, , True)
       myMenuBar.Visible = True
       
       Set newMenu = _
          myMenuBar.Controls.Add(Type:=msoControlPopup, Temporary:=True)
       newMenu.Caption = "Macros Menu"
    
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
           .Caption = "&Titlecase Selection"
           .TooltipText = "Change selected text to title case."
           .Style = msoButtonCaption
           .OnAction = "TitleCase"
       End With
       
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
           .Caption = "&Uppercase Selection"
           .TooltipText = "Upper Case Selected Text"
           .Style = msoButtonCaption
           .OnAction = "UpperCase"
       End With
       
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
           .Caption = "&Hidden Text Toggle"
           .TooltipText = "Reverses the setting for Show Hidden Text"
           .Style = msoButtonCaption
           .OnAction = "ToggleHiddenText"
       End With
    
       Set ctrl = newMenu.CommandBar.Controls.Add(Type:=msoControlButton, ID:=1)
       With ctrl
          .Caption = "&Add Quotes"
          .TooltipText = "Add appropriate type of quotes."
          .Style = msoButtonCaption
          .OnAction = "AddQuotes"
       End With
       
    End Sub                   'ApplicationMenu()
    
    '                         +-------------------------+             +----------+
    '-------------------------|  KillApplicationMenu()  |-------------| 09/03/14 |
    '                         +-------------------------+             +----------+
    'Version: 1.0
    
    Function KillApplicationMenu(zControlCaption As String)
    
       Dim mbTest   As Object  'Menu Bar Class
       Dim xControl As Object  'Control Class
       
       Set mbTest = CommandBars.ActiveMenuBar
       
       For Each xControl In mbTest.Controls
          '**** Change Caption below as necessary ****
          If xControl.Caption = zControlCaption Then
            xControl.Delete
          End If
       Next
       
    End Function              'KillApplicationMenu
    What the above looks like on the ribbon:
    Addins Menu.PNG

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Quote Originally Posted by sati View Post
    When Word 2007 came out I saw that it was not macro-friendly so didn't upgrade (writing them was not a problem, but you couldn't add them to the ribbon).
    Adding macros to the Ribbon has been possible with all Word versions from 2007 on. It's just much easier to do so with the later versions.

    According to Microsoft, Office 2003 isn't compatible with Win 10, bit it is compatible with earlier Win versions. Office 2003 hasn't been supported at all since early last year, but updates should still be available for download. Provided your PC's security is up-to-date, running Office 2003 shouldn't be a problem. All the same, though, Office 2003 has much less functionality than the more recent versions, of which Office 2010 was probably the best of the crop (IMHO).
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts
    sati, I second Macropod's recommendation. Word 2010 is stable, the interface is better than 2013 and 2016 (IMO), and unlike 2007, you can edit the ribbon (and yes, you can do this with 2013 and 2016). This means you can place each macro on the tab that's most appropriate for it.

    Kim

  6. #6
    Star Lounger Graham Mayor's Avatar
    Join Date
    Mar 2016
    Location
    Cyprus
    Posts
    68
    Thanks
    0
    Thanked 24 Times in 24 Posts
    FWIW Word 2003 runs quite happily in Windows 10 (I cannot speak for the rest of the Office suite). Updates can be a an issue. It can be updated to SP3, but support has ended and I don't believe the interminable security updates are still available.

    I too like Office 2010, but since I installed Windows 10 on a new SSD drive, I have found Office 2016 (the free standing version) completely stable and the only thing I don't like about it is the lack of local help, which is a pain when you can't always be sure that you can get near the internet. I can never remember the often arcane numeric equivalents of VBA switches, and as I get older I sometimes need to be reminded of syntax, so it's nice to have them to hand.

    As others have said Office 2010 and above have a built-in ribbon editor (for the Normal template). That's all very well for your personal use, but if you want to be more adventurous and apply ribbon settings to templates you will need to edit the ribbons of those templates - see http://gregmaxey.mvps.org/word_tip_p...bbon_main.html

    The problem with 2010 of course is finding a legitimate copy as it is no longer available from Microsoft.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •