Eric White
Forum Replies Created
-
AuthorPosts
-
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
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
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
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.
That is awesome! I’m glad my work is useful to you!
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
Good to know, thanks.
Awesome! Glad you got it working!
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
April 8, 2016 at 12:23 am in reply to: Modify active excel/word doc without closing it in openxml #3333Hi,
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
Absolutely! This code is now integrated into Open-Xml-PowerTools. You can find the axis methods in PtOpenXmlUtil.cs.
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
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
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
Hi,
Unfortunately, I don’t have the experience in this area.
What documentation does MS provide on the RibbonAndBackstageCustomizationsPart?
-Eric
-
AuthorPosts