none
WORD VBA 2007 to 2010 RRS feed

  • Question

  • Hi

    I would like to know how to convert WORD 2007 VBA utility to WORD2010 in easy way.  I have a VBA utility with forms and modules in WORD2007.I want to convert it into WORD2010.

    Could anyone help on this ?

    Thanks & Regards

    Hari


    Wednesday, August 29, 2012 8:56 AM

Answers

  • Hi Hari

    OK, I created a template in Word 2007, added a couple of Building Block entries to it, then saved it (*.dotx).

    I opened the template on a Word 2010 machine - note the emphasis on the word opened  - then  followed your steps. It worked just fine - the building blocks are still there.

    But looking at your screen shots, in the title bar I'm not seeing the name of the template, I'm seeing "Document1". This tells me you aren't opening the template, you're creating a new document from it. You need to OPEN the template. Don't double-click it in Windows Explorer. Right-click it and select "Open".

    After you convert it and save the changes then you can test creating a new document from the converted template.


    Cindy Meister, VSTO/Word MVP


    Monday, September 3, 2012 1:40 PM
    Moderator

All replies

  • Hi Hari

    For most things, no conversion should be necessary. Have you tested the utility in 2010? Could you please be more specific about what's not working?


    Cindy Meister, VSTO/Word MVP

    Wednesday, August 29, 2012 9:18 AM
    Moderator
  • Hi Cindy

    Its working  fine in compatibility mode. I want to convert (migrate) it to 2010 version as a part of business policy.

    Thanks & Regards

    Hari

    Wednesday, August 29, 2012 10:17 AM
  • Hi Hari

    I need to ask you again: If you convert/migrate the document, how is your current solution not working that you feel you need to change it?

    IOW, open the file that contains your code (docm or dotm), migrate it to the 2010 file format, save and test.


    Cindy Meister, VSTO/Word MVP

    Wednesday, August 29, 2012 4:39 PM
    Moderator
  • Hi Cindy

    The application is working in 2010. But its business decision to make it in 2010 format.

    I am doing that . I am opening 2007  files (Word document,Macro enabled template,Macro enabled document,Word template)  in 2010 one by one  convert and saving in 2010 format.(tedious work)

    Right now I am held up with converting templates (.dotx files)from 2007 to 2010. ( where the text blocks are available).

    When i open , convert and save template, the file is saved in 2010 format  but text blocks are missing.

    Cindy can u please tell me how to import 2007 word template into 2010 .

    Thanks & Regards

    Hari


    Thursday, August 30, 2012 6:58 AM
  • Hi Hari

    <<Right now I am held up with converting templates (.dotx files)from 2007 to 2010. ( where the text blocks are available).

    When i open , convert and save template, the file is saved in 2010 format  but text blocks are missing.>>

    Ok, I think we're getting closer to understanding your problem - but we're still not there. Could you please describe, very specifically, what you mean by "text block"? I'm not aware of anything that will be removed from a Word 2007 template when it is saved as a Word 2010 template. Are you sure you're specifically telling Word to save the file as a template?

    I ask because, if you save a template as a document all the Building Blocks will be cut out...


    Cindy Meister, VSTO/Word MVP

    Thursday, August 30, 2012 9:42 AM
    Moderator
  • Hi Cindy 

    let me put in detail

    we have an application in word to generate documents (say 50-100 pages).

    There are some pre defined document formats(boilers) available.

    The application will pick up one of pre-defined documents(boiler) format and add some more details from user screen and finally it will generate a document of some 50-100 pages .


    for this we have

    >  a Microsoft Word Macro-Enabled Tempate (where forms/user screen and modules are available)

    > Microsoft word documents ( predefined documents /boilers)

    > a Microsoft Word Template   (where building blocks available)

    the "text blocks" are building blocks only. i just called in other way :)

    I need to convert all these types files into 2010 format.

    please see the image below shows the template. the first one is in 2007

    and second is 2010 format. see the size of file

    same thing is happening for macro enabled template also

    .

    Could you please help me

    Thanks

    Hari

    





    Thursday, August 30, 2012 10:03 AM
  • Hi Hari

    Could you please turn on the display of file extensions on the machine where you took these screen shots? Do they have the same extension, or is one dotm and the other (smaller file) dotx?


    Cindy Meister, VSTO/Word MVP

    Friday, August 31, 2012 9:18 AM
    Moderator
  • Hi Cindy

    please see the screen shot

    l



    Thanks 

    Hari


    Friday, August 31, 2012 10:38 AM
  • Thank you, Hari

    Now could you please tell us the exact steps you use when saving these files in Word 2010 (when you convert them from 2007 to 2010 file format).

    And would it be possible for you to place such a file pair on Skydrive so that we can look at them and test?

    Actually, when I think about it, I'm not sure this is the best forum to answer the question, as the problem appears to be more an issue with the "end-user" configuration. But I haven't heard of such a problem, before, and searching the Internet doesn't turn up anything that matches your problem scenario. So it's really a bit of a puzzle as to what is happening.

    From the file sizes, it's obvious that content is being stripped out. Since this isn't something Word is supposed to do and, so far, no one appears to have reported similar behavior, my main suspicion is that we're dealing either with an Add-in that's doing this, a security software installed on your system, or some kind of virus. One way to test this would be to get a machine (laptop, maybe) that's never been in contact with your company's system and try doing the conversion on that.


    Cindy Meister, VSTO/Word MVP

    Friday, August 31, 2012 11:49 AM
    Moderator
  • Hi Cindy

    please see the steps i followed


    Could you please validate the steps. ?

    Please advice me the correct steps to follow

    Thanks & Regards

    Hari

    Monday, September 3, 2012 5:50 AM
  • Hi Hari

    OK, I created a template in Word 2007, added a couple of Building Block entries to it, then saved it (*.dotx).

    I opened the template on a Word 2010 machine - note the emphasis on the word opened  - then  followed your steps. It worked just fine - the building blocks are still there.

    But looking at your screen shots, in the title bar I'm not seeing the name of the template, I'm seeing "Document1". This tells me you aren't opening the template, you're creating a new document from it. You need to OPEN the template. Don't double-click it in Windows Explorer. Right-click it and select "Open".

    After you convert it and save the changes then you can test creating a new document from the converted template.


    Cindy Meister, VSTO/Word MVP


    Monday, September 3, 2012 1:40 PM
    Moderator
  • Thanks Cindy for your guidance and patience.

    FIRST TIME I FEEL A GREAT DIFFERENCE BETWEEN DOUBLE CLICK OPEN AND RIGHT CLICK OPEN A FILE  ;)

    Tuesday, September 4, 2012 4:48 AM
  • Hi Hari

    Yes, that's templates for you :-) When Word is installed, the DDE for Windows registers the default for the New rather than the Open command. Glad we found out the reason and that it wasn't too painful.


    Cindy Meister, VSTO/Word MVP

    Tuesday, September 4, 2012 10:14 AM
    Moderator