none
How to Change or update the object references in VB word Macros RRS feed

  • Question

  • HI friends,

    Im facing difficulity in changing/updating the available macro library references.

    pls find the below screenshot of word 2013 doc,

    I have to change the reference of Microsoft word 15.0 object library & Microsoft office 15.0 object library to

    Microsoft word 12.0 object & library Microsoft office 15.0 object library respectively as below.

    please suggest me the possible solution manually & through the coding.

    Wednesday, February 18, 2015 12:42 PM

Answers

  • Office COM libraries share the same CLSIDs so I don't think this is possible. You have a more recent version of Office installed so that is why you see 15.0 instead of 12.0.

    You should always develop your Office apps in the least version supported (in this instance Office 2007).

    This question appears to be Word VBA so I think Kevin is correct that it belongs in the Word for Developers forum.

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=worddev


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Wednesday, February 18, 2015 2:22 PM
  • Hi PTharak

    (Viewing the discussion in the Word for Developers forum)

    I agree with the opinions voiced by others that you need to set the Reference to the object library on a machine that has the corresponding version of Word installed. The only exception would be if you were coding in a .Net language against a set of PIAs because multiple versions of PIAs can be present on the same machine. This will not work for a COM programming language, however, because there you do link directly to the Office dlls, of which only one version will be available per Windows installation.

    Your only other option is to remove the references completely and change your code to use Late Binding, which is version-independent.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 18, 2015 8:57 PM
    Moderator

All replies

  • Hello,

    It is not clear what type of project this is. If VB6, not supported here (but can recommend another forum), if inside a MS-Word document I can move your question to the Word for developers forum.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

    Wednesday, February 18, 2015 1:35 PM
  • I think that you have to do this on machine that contains the corresponding (older) version of Office.

    Wednesday, February 18, 2015 1:46 PM
  • Office COM libraries share the same CLSIDs so I don't think this is possible. You have a more recent version of Office installed so that is why you see 15.0 instead of 12.0.

    You should always develop your Office apps in the least version supported (in this instance Office 2007).

    This question appears to be Word VBA so I think Kevin is correct that it belongs in the Word for Developers forum.

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=worddev


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Wednesday, February 18, 2015 2:22 PM
  • Hi PTharak

    (Viewing the discussion in the Word for Developers forum)

    I agree with the opinions voiced by others that you need to set the Reference to the object library on a machine that has the corresponding version of Word installed. The only exception would be if you were coding in a .Net language against a set of PIAs because multiple versions of PIAs can be present on the same machine. This will not work for a COM programming language, however, because there you do link directly to the Office dlls, of which only one version will be available per Windows installation.

    Your only other option is to remove the references completely and change your code to use Late Binding, which is version-independent.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, February 18, 2015 8:57 PM
    Moderator
  • thanks kevin for the reply, i move this question to word forum.

    Thursday, February 19, 2015 7:27 AM
  • thanks paul,  i move this question to word forum.
    Thursday, February 19, 2015 7:28 AM
  • Hi friends,

    • we have a macro enabled word 2007 document in our dev server.
    • New word docs are created based on this macro enabled template in sharepoint library.
    • In my local machine if I open/edit the newly added document( i.e Edit in microsoft word) ,it opens in word 2013 as my local has only word 2013 & not word 2007.
    • IF I open/edit newly created docs in dev server it will open in word2007.
    • we face an issue in our vba code (i.e macro code), in the code a XML is generated from one of picture content control embedded in word & it differs for both 2007 & 2013.and due to this XML variation code breaks.
    • XML generation "control.Range.WordOpenXML"  where control is picture control
    • just thinking to change the object library reference for the word 2013 to the orginal word 2007. but cant able to change it. pls suggest

    Word 2013 in my local,

    have to change the reference of Microsoft word 15.0 object library & Microsoft office 15.0 object library to

    Microsoft word 12.0 object & library Microsoft office 15.0 object library respectively as below.

    pls note: I also tried changing the compatibility of word 2013 to 2007 ., no use.
    kindly suggest me if there is any other solution for the above.

    Thursday, February 19, 2015 7:35 AM