Search Results

Search found 3 results on 1 pages for 'ydobonmai'.

Page 1/1 | 1 

  • Iterating XML nodes using VBA

    - by ydobonmai
    Note:- It just might be a iterating XML nodes using VBA question. Please look at the bottom of this question. It would be good If we can iterate without using MSXML2.DOMDocument I see the this question which answers part of my question on how to retrieve the CustomXMLPart. However, I am not able to iterate through the Xml. That way, this might not be specific to CustomXmlPart, It just might be a iterating XML using VBA question. Following is the XML I have in my CustomXMLPart. <Items> <Item1>Item1</Item1> <Item2>Item2</Item2> <Item3>Item3</Item3> </Items> This is how I add the above XML as CustomXmlPart:- static void AddCustomTableXmlPart(WordprocessingDocument document) { MainDocumentPart mainDocumentPart = document.MainDocumentPart; XDocument itemXml = GetItemsAsCustomXML(); if (mainDocumentPart.GetPartsCountOfType<CustomXmlPart>() > 0) mainDocumentPart.DeleteParts<CustomXmlPart>(mainDocumentPart.CustomXmlParts); //Add a new customXML part and then add content var customXmlPart = mainDocumentPart.AddCustomXmlPart(CustomXmlPartType.CustomXml); //copy the XML into the new part... using (var ts = new StreamWriter(customXmlPart.GetStream())) { ts.Write(itemXml.ToString()); ts.Flush(); } } and this is how I am accessing it in the macro:- Dim itemNode As xmlNode Dim itemChildren As XMLNodes ' The below line throws a run-time error 'Run-time error '13' - 'type mismatch ' not sure why. **Set itemChildren= ActiveDocument.CustomXMLParts(ActiveDocument.CustomXMLParts.Count).SelectSingleNode("//Items").ChildNodes** Interestingly, when I quick watch ActiveDocument.CustomXMLParts(ActiveDocument.CustomXMLParts.Count).SelectSingleNode("//Items").ChildNodes, I see child items in the quick watch window. Is the assignment to the itemChildren variable incorrect? I want to iterate through all the items and get get text for all of them. Could anybody help?

    Read the article

  • Ribbon not showing up with dynamically generated ribbon XML from the database

    - by ydobonmai
    I am trying to form ribbon XML with the data from the database and following is what I wrote:- XNamespace xNameSpace = "http://schemas.microsoft.com/office/2006/01/customui"; XDocument document = new XDocument(); document.Add( new XElement (xNameSpace+"customUI" , new XElement("ribbon" , new XElement("tabs")))); // more code to add the groups and the controls with-in the groups ....... // code below to add ribbon XML to the document and to add the relationship RibbonExtensibilityPart ribbonExtensibilityPart = myDoc.AddNewPart<RibbonExtensibilityPart>(); ribbonExtensibilityPart.CustomUI = new DocumentFormat.OpenXml.Office.CustomUI.CustomUI(ribbonXml.ToString()); myDoc.CreateRelationshipToPart(ribbonExtensibilityPart); I don't see any error executing the above. However, when I open the changed document, I dont see my ribbon added. I see following in the CustomUI/CustomUI.xml inside the word:- <?xml version="1.0" encoding="utf-8"?><customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon xmlns=""> <tabs> ..... I am not sure how the "xmlns" attribute is getting added to the ribbon element. When I remove that attribute, the ribbon gets showed. Could anybody throw any idea on where am I going wrong?

    Read the article

  • JQuery - Microsoft JScript runtime error: Object expected

    - by ydobonmai
    Below is the content of my .aspx page and the "jquery-ui-1.7.1.custom.min.js" is in the same location as the .aspx file. When I run the website with debugging, I get the below error. I know I am terribly missing something here. Any clue? Error :- Microsoft JScript runtime error: Object expected When I run without debugging, I get the following javascript error:- Line: 10 Error: 'jQuery' is undefined ASPX page content:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script> </head> <body> <form id="form1" runat="server"> <div> <script>$(function () { alert('hello') });</script> </div> </form> </body> </html>

    Read the article

1