none
Convert old Word marco to Office 2010

    Question

  • Hi,

    We were using Office XP for years and just updated to Office 2010. We do have alot of user templates and marcos used in XP. Right now we need to convert those marcos one by one and will take forever to complete. I want to know if there any way I can convert the marcos (.dot) to the latest version or xml format??

    I also want to know if it's possible to create our own icons other than using the Office built in icons.

    Thanks.

    P.S.  I did post in other fourms and they refered me to this MSDN fourm.

    Monday, September 30, 2013 9:10 AM

Answers

  • Hi Hons

    Given that your question has mutated from a "Where do I put a template with Ribbon customizations linked to macros" to a "How do I configure users' workstations in a roaming environment" I suggest that you continue to pursue the discussion in the IT Pro forums on the Technet site. Those folks can best advise you how to set things up in your company. The MSDN forum focuses mainly on the programming API. While the two can intersect, the folks in the TechNet forum have more experience and information how to best set up company-wide configurations.

    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=word

    When you post there, be sure to clearly outline exactly what you want to achieve in standardizing your users' Word configurations. (I'd offer to move this discussion, but it's become so long and involved that you're unlikely to get a good response as it won't be obvious why the discussion has been moved to TechNet.)

    Up until now, this discussion was never about the Normal template; it was about a template containing Ribbon customizations. The Normal.dotm templates never belongs in the Startup folder. It should be left in the designated installation location for the user's templates. If you put it in Startup, Word will try to load it twice, which is never a good idea.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 03, 2013 2:41 PM

All replies

  • Many of your macros might not require any changes to work with Office 2010. Whether any changes might be needed to a given macro and what those changes must be can only be determined on a case-by-case basis.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, September 30, 2013 10:32 AM
  • Hi Paul,

    Many thanks for your reply. Right now the way we're converting one by one from .dot to dotx. But the process is slow and some other co-worker didn't deal with this before would not know how to modify after vonvert. So, I'm looking to see if we can convert them into xml format that people will easier to troubleshoot.

    Is that possible??

    Also, we assigned each marco a custom icon when in XP but now we cannot use them in 2010. Is there any way we can insert the icon we created to the list of icons in the Word??

    Thanks. 

    Monday, September 30, 2013 3:40 PM
  • Hi Hons

    <<Right now the way we're converting one by one from .dot to dotx.>>

    I hope you're saving as *.dotm and not *.dotx. If these files are being saved as *.dotx then the macros will be deleted. Macros can be saved only in *.docm and *.dotm files.

    I'm not sure what help you think converting to XML will be. Macros remain in the old binary format, even when documents are saved to an XML format (including the new 2007+ file format - dotm).

    If these macros are linked to toolbar customizations, then the toolbar customization should remain in the template. They will ALL be located in the Add-ins tab of the Ribbon. I think the icons are retained? Are you not seeing that?

    If you're assigning icons to macros via Word's built-in Ribbon customization interface then you cannot select custom icons. But if you include a Ribbon XML in the template than you can use custom icons. This is most easily done using the freely downloadable CustomUi Editor:

    http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2010/08/10/23248.aspx


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, September 30, 2013 5:53 PM
  • I hope you're saving as *.dotm and not *.dotx. If these files are being saved as *.dotx then the macros will be deleted. Macros can be saved only in *.docm and *.dotm files.

    (This is why we confused. So, that means we can convert and save as .dotm and the marcos should wrok as before.)

    I'm not sure what help you think converting to XML will be. Macros remain in the old binary format, even when documents are saved to an XML format (including the new 2007+ file format - dotm).

    (The reason is the old marcos were written by old staffs who did have too much tech background and they worte whatever way to make it work and there staffs are going to retire so we want to convert them into a standard format so the new programmer will understand what the old staffs wanted to do.)

    If these macros are linked to toolbar customizations, then the toolbar customization should remain in the template. They will ALL be located in the Add-ins tab of the Ribbon. I think the icons are retained? Are you not seeing that?

    (The templates are there. we can add them to the ribbon but it doesn't allow to add our own old icons and we can't find any way to create our own.)

    If you're assigning icons to macros via Word's built-in Ribbon customization interface then you cannot select custom icons. But if you include a Ribbon XML in the template than you can use custom icons. This is most easily done using the freely downloadable CustomUi Editor:

    I got that link and I'm going to try on it. The question is "what would be the restriction on the size and type of the icon [like 20x20, only in square type ...]?? What format the icon file should be used??

    Do you have any info about these??

    Thanks again for your reply. 

    Monday, September 30, 2013 6:10 PM
  • Hi Hons

    Concerning XML: So as I understand it, you're primarily looking for a way to document the old code outside the VBA Editor? You can do this by viewing the macro in the VBA Editor then going to File/Export. This will save the content of what you're currently viewing (the entire page of code) to a *.bas file - pure text. It will also work for Forms.

    If something should go wrong during conversion File/Import can be used to bring these files back into the Word document/template. So this also functions like a back-up.

    Ribbon icons: When using the CustomUi Editor *.png format is probably best. I believe that "transparent" is supported, but it is still a raster. I'm not sure if 16x16 or 32x32.


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, September 30, 2013 7:04 PM
  • I hope you're saving as *.dotm and not *.dotx. If these files are being saved as *.dotx then the macros will be deleted. Macros can be saved only in *.docm and *.dotm files.

    (This is why we confused. So, that means we can convert and save as .dotm and the marcos should wrok as before.) 

    FWIW, you could use another macro to automatically convert your all .dot files to the .dotm format. That doesn't guarantee the macros will all work correctly, since some of your old code may not be compatible with the new environment, but at least the basic file conversion part of the process will be out of the way. For example, if your code relies on the presence of a file in a particular location, the filepath might now be different and, if you're working with files in the new format, you'll need to specify the .docx or .docm extension, for example instead of .doc.

    You could also use a macro to export all the code modules to .bas files per Cindy's post.

    Ultimately, validating and debugging your old code for the new environment is liable to take far longer than the simple file conversion part of the process.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, September 30, 2013 8:57 PM
  • Yes, you're correct and that's why we're still converting one by one!!!

    One more question is in order to make the macros run in 2010, the .dotm has to be located in C:\Program Files\Microsoft Office\Office14\STARTUP\. When I put the file there, I have to give users full right in order to let the macros run otherwise the macros will have error. Do you know why??

    Also, if I want all the users be able to use the ribbon, where should I put the Ribbon.OfficeUI file??

    Thanks.

    Monday, September 30, 2013 10:16 PM
  • The answer probably depends on what the error is and what the code is trying to do at that point. If all you mean is that the users get a macro warning, that's not an error, it's a reflection of your macro security settings. You can avoid those messages by reducing the macro security (not recommended) or storing the files in any trusted location (you might even consider making the current location a trusted one).

    I haven't used the Ribbon.OfficeUI, so I can't advise on that.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, September 30, 2013 10:55 PM
  • Picking up on Paul's answer...

    The user's Startup folder should be a trusted folder, so I'd be surprised if this were a macro warning. What is the error message you're seeing?

    FWIW, though, a template does require write permissions to the folder in which it is stored. Word needs to be able to manage the "scratch" files for any file it loads.

    But you should find another Startup folder in the users' "Roaming" profile. By default, on Windows 7, it's here:

    C:\Users\[profile name]\AppData\Roaming\Microsoft\Word\STARTUP

    The Ribbon should be saved in the template file, so all you need to do is provide the template. You shouldn't be "fiddling" with the users' Ribbon.OfficeUI file unless your company wants to ensure that everyone is using the same Ribbon. But that's not how Word was designed to be used...


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, October 01, 2013 3:36 PM
  • The problem we have is we don't want the marcos and the ribbon follow users because each of office have their own setup and users are are always moving to other offices to help out. Right now I put the files:

    1)  Normal.dotm in C:\Program Files\Microsoft Office\Office14\STARTUP\

    This caused error said cannot found the template file unless I give full right to the folder.

    2)  Ribbon.OfficeUI C:\Users\%username%\AppData\Roaming\Microsoft\Office\

    This location make other users cannot see the Ribbon.

    Tuesday, October 01, 2013 4:06 PM
  • Cindy,

    Any more help please??

    Wednesday, October 02, 2013 10:33 PM
  • Hi Hons

    Given that your question has mutated from a "Where do I put a template with Ribbon customizations linked to macros" to a "How do I configure users' workstations in a roaming environment" I suggest that you continue to pursue the discussion in the IT Pro forums on the Technet site. Those folks can best advise you how to set things up in your company. The MSDN forum focuses mainly on the programming API. While the two can intersect, the folks in the TechNet forum have more experience and information how to best set up company-wide configurations.

    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=word

    When you post there, be sure to clearly outline exactly what you want to achieve in standardizing your users' Word configurations. (I'd offer to move this discussion, but it's become so long and involved that you're unlikely to get a good response as it won't be obvious why the discussion has been moved to TechNet.)

    Up until now, this discussion was never about the Normal template; it was about a template containing Ribbon customizations. The Normal.dotm templates never belongs in the Startup folder. It should be left in the designated installation location for the user's templates. If you put it in Startup, Word will try to load it twice, which is never a good idea.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 03, 2013 2:41 PM
  • Hi Cindy,

    Thanks for your clearify. I do understand that some part of the problem is not belong to this forum. I just don't want to ask the same question it different place and need to combine back together. Sorry for the trouble.

    Regarding yout explaination. does that mean I should insert the icon to the normal.docm one ny one. But the problem is each normal contain 1-200 macros?? Is there any way to speed up the process?? 

    Thursday, October 03, 2013 3:35 PM
  • Hi Hons

    At this point, I'm confused and really do NOT understand what it is you're trying to achieve. That's one reason I pointed you at the configuration forum: So that you could set out exactly what you require for your users' machine configurations in a fluid manner, without someone needing to wade through a lot of back-and-forth and possibly irrelevant information.

    The Normal.dotm template is NOT the right place for you to store customizations of this nature, including macros. They belong in a separate template, stored in the users' STARTUP folders. There's the templates will function as Add-ins and won't be affected by anything the user does that could change Normal.

    The folks in TechNet should also be able to tell you how topic up the users' copy of Normal through there roaming profile and load it to whatever machine they log into. That's why I want you to go ask the configuration experts. I only know it can be done, I don't know how to actually DO it.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 03, 2013 3:54 PM
  • I know this is confuse!!! It's all started from Office 98. At that time the users created some Marco to work in the Word (And created a Normal.dot). They never upgrade until now. It's because some of the Marco will not run in Office 2010 so they decided need to upgrade. The problem is, at that time they only work on the "Normal.dot" and they can insert the icons they want. Now in the 2010, we have to convert the Normnal.dot to .dotm and we still cannot add custom icons.

    I'm here because I need a way to add the icons into the Marco (either modify or create another file). And since from Office 95 we put the Normal.dot in the startup folder so I want to clarify where I should put the file in Office 2010. What I want is all users share 1 basic template and they can add whatever they need.

    Could you help me on this??

    Thanks., 

    Thursday, October 03, 2013 5:46 PM
  • Now we're going around in circles...

    I've described how you have to add a RibbonXML to a document in order to use custom images on the buttons in my first reply in this thread.

    Please ask in the TechNet IT Pro forum about where and how to deploy it.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 03, 2013 5:54 PM