Re: Create WordML via XSLT with embedded macros
- From: Cindy M -WordMVP- <C.Meister-C@xxxxxxxxxx>
- Date: Mon, 11 Jul 2005 14:38:02 +0200
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 :-)
.
- Follow-Ups:
- Re: Create WordML via XSLT with embedded macros
- From: Martin Leim
- Re: Create WordML via XSLT with embedded macros
- References:
- Create WordML via XSLT with embedded macros
- From: Martin Leim
- Create WordML via XSLT with embedded macros
- Prev by Date: Trapping a file name from userform
- Next by Date: Re: I can't exit design mode
- Previous by thread: Create WordML via XSLT with embedded macros
- Next by thread: Re: Create WordML via XSLT with embedded macros
- Index(es):
Relevant Pages
|