|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Hello all,
I am writing a VBA add-in to Word 2003. I am attempting to add a block of XML data to a section of the Word doc the user has selected. I would like the XML to look something like
<OBSection username="jsmith" sectionName="section1"> rest of the highlighted information </OBSection>
I am able to add the XML element via
Set beginRange = Selection.Range Set ParentNode = Selection.Range.XMLNodes.Add("OBSection", "http://www.gs.com/ed")
with the result <OBSection>Section 1 </OBSection>
but I need to know how to add the attributes
my schema is attached for reference:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="OBSection" type="OBSection"/>
<xsd:complexType name="OBSection" mixed="true"> <xsd:attribute name="userName" type="xsd:string" use="optional"/> <xsd:attribute name="SectionName" type="xsd:string" use="optional"/> </xsd:complexType> </xsd:schema>
Any help would be appreciated...
Thanks
|
|
|