A macro from words in VB doesn't works in Explorer local

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JosM
    New Member
    • Feb 2008
    • 3

    A macro from words in VB doesn't works in Explorer local

    Hello,
    I've made a macro (see in jos_xmlHTM.htm) in Words to change a XML file (josxml.xml) and save it as a new file (josxml2.xml).
    In words everything will be ok, it works.

    When i make a htm file of it and put the macro in there (see in jos_xmlHTM.htm) it doesn't work.

    The files jos_xmlHTM.htm and the josxml.xml you can find on:


    or in the attachment.

    you can email to info@jmoeskops. nl

    I hope i posted this in the write forum.

    Can somebody help me?
    Thanks for your help.
    Attached Files
  • VBWheaties
    New Member
    • Feb 2008
    • 145

    #2
    Originally posted by JosM
    Hello,
    I've made a macro (see in jos_xmlHTM.htm) in Words to change a XML file (josxml.xml) and save it as a new file (josxml2.xml).
    In words everything will be ok, it works.

    When i make a htm file of it and put the macro in there (see in jos_xmlHTM.htm) it doesn't work.

    The files jos_xmlHTM.htm and the josxml.xml you can find on:


    or in the attachment.

    you can email to info@jmoeskops. nl

    I hope i posted this in the write forum.

    Can somebody help me?
    Thanks for your help.
    You are trying to work with Words Document object without a CreateObject/GetObject call.

    Comment

    • JosM
      New Member
      • Feb 2008
      • 3

      #3
      Originally posted by VBWheaties
      You are trying to work with Words Document object without a CreateObject/GetObject call.
      Hello, thanks for your replay.

      Do you know how it must look like? I'm completly new in VBscripts.

      Regards Jos

      Comment

      • VBWheaties
        New Member
        • Feb 2008
        • 145

        #4
        Originally posted by JosM
        Hello, thanks for your replay.

        Do you know how it must look like? I'm completly new in VBscripts.

        Regards Jos
        Create an instance of Word application:
        Code:
        Dim wrdApp
        Set wrdApp = CreateObject("Word.Application")
        Create the instance for your document:
        Code:
        Dim wrdDoc
        Set wrdDoc = wrdApp.Documents(1)
        Then, you can take it from there.

        For additional information and more complete examples:

        Comment

        Working...