Re: Create WordML via XSLT with embedded macros

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi =?Utf-8?B?TWFydGluIExlaW0=?=,

Assuming we're discussing Word 2003, Professional version...

It works fine, here. The attribute w:macrosPresent="yes" must be in the
w:wordDocument element. And the set of tags
<w:docSuppData><w:binData w:name="editdata.mso">binary data here

has to follow the <w:styles> and precede the <w:docPr> sections. When I do
that, then apply the transform to an XML file using MSXML (or a .NET XML
class) then save the result as a file and open it in Word, the AutoOpen macro
fires correctly.

You can't get the macro to show up by applying the transform to an already
opened XML file, though, if that's what you've been doing.

> I have some XML file and want to transform it into Word(Processing)ML via
> XSL-Transformation. I want to include some vba macro in it which runs when
> the document is opened.
> By looking at a WordML document with macros in it I learned that the macro
> is embedded via base64 encoded binary data and in the word document header
> there is a flag indicating we have embedded macros.
>
> Now I copied this piece of binary code into my xsl file and applied it to
> the xml. Now I get an "Unknown Error" with reference to the line and column
> (its somewhere in the binary data).
>
> It maybe that I am missing something in my XSLT file.
> If I use the XSLT Inference Tool to create a XSLT I don't get an error, a
> security warning concerning macros is showing up, but no macro is executed
> (and none is in the code editor).
>
> So is there a (working!!) possibility to include a macro that really works
> in my XSLT file? The macro is constant, it doesn't have to change, so it
> would be OK tu use this binary piece of code.
> But how can I include it the way it works?
>
> Thanks in advance for anyone having an idea.
>

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

.



Relevant Pages

  • Re: Word 200 Macro using replace
    ... this field is populated from different fields in an XML file. ... The carraige ... returns aren't part of the template, they come from the XML file". ... > create a macro that will run automatically everytime a new .doc file is ...
    (microsoft.public.word.docmanagement)
  • Workbooks.Open oddity
    ... I need to work with some data columns from a xml file. ... When I start the macro via a commandbarbutton from one of my add-ins ...
    (microsoft.public.excel.programming)
  • Re: Set up button to import an XML file
    ... Can you post an example of the XML file ... couldn't figure out how to specify the file. ... I do a daily import of a text file, via macro and command button ... Macro is Import Delimited into a table from a specified text file ...
    (microsoft.public.access.reports)
  • Re: Filling dropdown values from remote xml file
    ... anjanesh Wrote: ... I need to make one cell a drop down. ... values that is to be retrieved from the net as an XML file. ... using .NET but how do I get the url content in the macro? ...
    (microsoft.public.excel.programming)
  • Create WordML via XSLT with embedded macros
    ... I have some XML file and want to transform it into WordML via ... By looking at a WordML document with macros in it I learned that the macro ... (its somewhere in the binary data). ... It maybe that I am missing something in my XSLT file. ...
    (microsoft.public.word.vba.general)