Eric White

Forum Replies Created

Viewing 15 posts - 181 through 195 (of 253 total)
  • Author
    Posts
  • in reply to: Merging DOCM documents #3357

    Eric White
    Keymaster

    Hi Tobi,

    Question: if you don’t mind sharing, what is your ‘use case’? What user story do you need to enable?

    Sometimes there are better solutions than using macros (but sometimes not). Generating documents that contain macros would trigger that ‘Better do a full threat analysis’ response, as in the book “Writing Secure Code“.

    I am pretty enthused about the new JavaScript add-in model for Office. You can do a lot with it.

    -Eric

    in reply to: Merging DOCM documents #3355

    Eric White
    Keymaster

    Hi,

    You are correct, it is not a supported feature. For this to be supported, would require deciding how to incorporate macros from multiple documents, and I’m not sure how well that would work, or whether that would be a good idea.

    I would take the approach of converting to DOCX (stripping out the macros), do the merging, and then put the macros back in, making it a DOCM again. I have never written this code, but would be a matter of copying over some binary parts, creating parts with correct content types, and creating correct relationships, and probably changing the content type for the main document part. Then can change back to a DOCM, and the macros should work.

    -Eric

    in reply to: WmlToHtmlConverter and Header Footers #3352

    Eric White
    Keymaster

    Hi,

    In order to show headers and footers, the WmlToHtmlConverter would need to have a layout engine to do pagination. This is not a feature of WmlToHtmlConverter – it is the most requested feature, of course.

    I have looked at what it would take to add pagination to WmlToHtmlConverter, and it is a non-trivial project. It is not currently at the top of the list, unfortunately.

    I am unfamiliar with BFO compliant HTML.

    With regards to merging data, have you looked at the DocumentAssembler module?

    http://www.ericwhite.com/blog/blog/documentassembler-developer-center/

    Cheers, Eric

    in reply to: Adding tables from spreadsheets #3346

    Eric White
    Keymaster

    Take a look at SmlDataRetriever – you don’t need to be able to code it, just use it. 🙂

    Its use is pretty easy. Look at the SmlDataRetriever01 example to see it in action.

    in reply to: link to code download broken #3341

    Eric White
    Keymaster

    That is awesome! I’m glad my work is useful to you!

    in reply to: How to add a jquery chart to an openxml word doc? #3339

    Eric White
    Keymaster

    Hi,

    In order to figure this out, I recommend using the approach detailed in:

    How to Research Open XML Markup

    This is the approach I would need to take in order to figure out the answer to your question. Of course, I could do this, but it would be better for you to learn how to do this for yourself. 🙂

    Cheers, Eric

    in reply to: Show thumbnail of an OPC file #3338

    Eric White
    Keymaster

    Good to know, thanks.

    in reply to: How to create HyperlinkOnClick using Linq to xml? #3336

    Eric White
    Keymaster

    Awesome! Glad you got it working!

    in reply to: AutoPlay video #3335

    Eric White
    Keymaster

    Hi,

    I don’t know the answer to your question.

    The way to determine what you need to do is to first manually set up a presentation so that it behaves exactly as you wish, and then generate the same markup.

    If you are not familiar with the technique of using the Open XML SDK Productivity Tool to compare files to identify necessary markup, I suggest watching this video:

    How to Research Open XML Markup

    This is what I would have to do in order to answer your question 🙂

    It is pretty fun to use this technique, identify the changes you need to make, and then generate the presentation with those changes, and see it work.

    Cheers, Eric

    in reply to: Modify active excel/word doc without closing it in openxml #3333

    Eric White
    Keymaster

    Hi,

    With Word, you can use the approach detailed in the following MSDN article:

    Increasing Word Automation Performance for Large Amounts of Data by Using Open XML SDK

    However, there is no equivalent functionality in Excel so that from within an add-in, you can get the Open XML markup, modify, and then put it back, as you can do in Word.

    -Eric

    in reply to: link to code download broken #3332

    Eric White
    Keymaster

    Absolutely! This code is now integrated into Open-Xml-PowerTools. You can find the axis methods in PtOpenXmlUtil.cs.

    in reply to: DocumentBuilder #3331

    Eric White
    Keymaster

    This is certainly possible, although this is not what is implemented, as you know, in DocumentBuilder04.

    Basically, what you would need to do is to use the approach detailed in Advanced use of DocumentBuilder screen-cast, #6 in the following list:

    DocumentBuilder Developer Center/

    Instead of simply creating sources, you want to add the special element inside the content control, and specify the source in that element.

    As a first step, experiment with the advanced use of DocumentBuilder by writing example programs, until you understand exactly how it works.

    -Eric

    in reply to: Adding tables from spreadsheets #3329

    Eric White
    Keymaster

    Hi,

    I am currently working on (in the background) a conversion of SpreadsheetML to HTML/CSS. One idea here is that you can generate the HTML/CSS for a table or region in a spreadsheet, and then create a DOCX using the HtmlToWmlConverter module. You can then integrate this DOCX into other DOCX using DocumentBuilder.

    However, I am only half done with this module – I have coded the SmlDataRetriever, which retrieves the data along with relevant formatting information. One thing that this module does, which will be super important to you, is that it puts together the display value. In other words, it converts from the raw data in the XLSX to the value that you see when looking at the spreadsheet using Excel (the value you retrieve when getting the value using VBA).

    It is actually not a huge job remaining to create the HTML/CSS from the data that SmlDataRetriever returns, but I haven’t had the time.

    You very well may want to take the same approach – use SmlDataRetriver to get the data, and then generate HTML/CSS from that data, and then generate the DOCX markup using HtmlToWmlConverter. (If you want to contribute this code to Open-Xml-PowerTools, I would be happy!)

    But in any case, SmlDataRetriever is what you want to use.

    -Eric

    in reply to: Getting stream for SlideLayoutPart of a slide. #3328

    Eric White
    Keymaster

    Hi,

    I have never tried to create a slide from scratch. Instead, my approach is to create a one-slide presentation with the slide as I desire it, and then integrate the slide using PresentationBuilder, and then if necessary modify the slide after PresentationBuilder is done with it.

    When you create a part, it is initially empty, but you can get the XDocument, then modify it. Following is the code to create a new comments part, and the initialize the XDocument.

        mainPart.AddNewPart<WordprocessingCommentsPart>();
    

    newComments = mainPart.WordprocessingCommentsPart.GetXDocument();

        newComments.Declaration.Standalone = "yes";
    

    newComments.Declaration.Encoding = “UTF-8”;

        newComments.Add(new XElement(W.comments, NamespaceAttributes));
    

    commentNumber = 1;

    -Eric

    in reply to: Populate CustomUI for Excel 365 Backstage #3327

    Eric White
    Keymaster

    Hi,

    Unfortunately, I don’t have the experience in this area.

    What documentation does MS provide on the RibbonAndBackstageCustomizationsPart?

    -Eric

Viewing 15 posts - 181 through 195 (of 253 total)