Eric White

Forum Replies Created

Viewing 15 posts - 61 through 75 (of 253 total)
  • Author
    Posts
  • in reply to: Update TOC using macro #3782

    Eric White
    Keymaster

    Hi @sliu,

    At the time I was working on that screen-cast series, I got diverted to another project, and never recorded the approach using a macro enabled document, and I’m afraid I don’t remember the details. But I still believe it to be possible to create a macro-enabled document. See the following:

    https://support.office.com/en-us/article/Run-a-macro-5e855fd2-02d1-45f5-90a3-50e645fe3155#bmrunmacroautomatically

    Cheers, Eric

    in reply to: OpenXmlPowerTools #3775

    Eric White
    Keymaster

    Hi Manohar,

    Certainly! It is licensed under the Microsoft Public License (Ms-PL). The license gives you wide latitude in how you use it.

    Cheers, Eric

    in reply to: Word Document Table Borders #3773

    Eric White
    Keymaster

    You probably will need to tweak the widths of the borders – if they are too thin, then make them thicker. There probably is no other solution.

    Cheers, Eric

    in reply to: WmlToHtml in Revision Tracked Document #3772

    Eric White
    Keymaster

    Hi Hans,

    The WmlToHtmlConverter (which is the new name for HtmlConverter) module does not display revision tracking marks. This is not a feature of the module.

    I have often contemplated adding this functionality to that module, but it has never risen to the top of the list of projects yet.

    If I recall correctly, the WmlToHtmlConverter module accepts all tracked revisions before doing the transform.

    I have also contemplated a transform that converts a DOCX with revision tracking marks to another DOCX where rev tracking marks are converted to red-line ordinary markup, in other words, a document with text that has strike-through for deleted text, and underline for inserted text, with appropriate colors. But that module also has never risen to the top of the pile.

    Sorry, wish I had a better answer for you, but I don’t.

    Cheers, Eric

    in reply to: Extract FieldCodes #3771

    Eric White
    Keymaster

    Hi,

    There are three forms of field codes:

    • There is the form that has fldChar with begin/separate/end
    • There is a simple form of fields, which use the fldSimple element
    • There is a variation on fldSimple, which is the w:hyperlink element

    You can find hyperlinks in both forms – fldChart/begin/separate/end form, and w:hyperlink form. Your code needs to be prepared to handle either. To make matters more fun, when you have a w:hyperlink element, the URI is stored as an external relationship. When using the fldChar/begin/separate/end form, the hyperlink is stored in the text of the field code.

    It is a bit of a mess, IMO.

    If I recall correctly, in the WmlToHtmlConverter, I converted all fields that are in the fldChar/begin/separate/end to the w:hyperlink form, so that the transform can handle all hyperlinks in the same way. That approach might be useful to you.

    Cheers, Eric

    in reply to: Open XML Package Editor for VS doesn't open .pptx as zip file #3770

    Eric White
    Keymaster

    Yes, this has happened to me. My solution:

    Uninstall the Package Editor, Uninstall VS, reinstall VS, reinstall the package editor. AFAIK there is no other solution.

    IIRC, this occurs when you install Office after installing VS on a machine, and Office changes the registry or something in some way that causes this behavior.

    Things like this is why I always have two fully functional development machines running – I can switch to the other machine, and continue working while uninstalling/reinstalling.

    Wish I had a better answer for you, but I’m afraid that this is the only way to deal with this.

    You might be able to do File/Open the PPTX file and it might open using the Package Editor, even if the registry is messed up. It has been a couple of years since I encountered this because I am careful to first install Office, and then install VS, and finally install the Package Editor.

    Cheers, Eric

    in reply to: Merging documents #3769

    Eric White
    Keymaster

    Hi Garth,

    Have you reviewed all of the screen-casts on DocumentBuilder?

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

    Specifically, the last screen-cast shows how to deterministically work with headers/footers.

    One thing that you could do is to remove the sections from the document that you get after converting the Html to WordprocessingML. Just remove the w:sectPr elements from the body of the document.

    You can then control headers/footers using DocumentBuilder. In general, I believe that it is possible to do what you want to do. I am not fully sure of exactly where the error is occurring in your process, though.

    Cheers, Eric

    in reply to: Search and replace in a file – in memory #3768

    Eric White
    Keymaster

    Great, glad you got it working.

    Check out this MSDN article:

    https://msdn.microsoft.com/en-us/library/ee945362(v=office.11).aspx

    Cheers, Eric

    in reply to: MSDN Sample to Create Presentation makes empty presentation #3767

    Eric White
    Keymaster

    Hi Terry,

    I didn’t write that code, and don’t know any details about it. It is written in a style that is different from the way I write.

    I would take the approach that I showed in the screen-cast.

    Alternatively, you could use the OpenXmlRegex module to search/replace content in presentations.

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

    Cheers, Eric

    in reply to: DocumentBuilder inserting header/footer? #3766

    Eric White
    Keymaster

    Hi,

    This is a very good question.

    There was an interesting issue a couple of years ago that had to do with headers being inherited from previous sections with fairly random behavior, so at that time I enhanced DocumentBuilder to be deterministic and precise about generation of headers/footers, and IIRC, there was an issue where a section has no headers/footers, perhaps I generate blank headers / footers for the section, because if they are not there, then they can inherit *wrong* headers/footers from previous sections.

    But frankly I can’t recall the details, and without reading the code don’t fully know why you are seeing what you are seeing.

    There is a lot of code in DocumentBuilder to deal with headers/footers, and I am not surprised to hear of an issue.

    One think to keep in mind – after generating the document, it is a super-simple operation to remove the headers/footers as necessary. However, changing them or adding them is a different story – can be a bit complicated. The entire semantics are documented in the standard, but it is not simple.

    Cheers, Eric

    in reply to: Conversion of content in tags #3764

    Eric White
    Keymaster

    The HtmlToWmlConverter was not designed to support definition lists. This is not a feature of the module.

    I recommend removing those tags from the source HTML before invoking the HtmlToWmlConvert module.

    The HtmlAgilityPack is a good API for doing this type of stuff.

    https://htmlagilitypack.codeplex.com/

    Cheers, Eric

    in reply to: HTML Converter does not put tfoot at bottom of table in WML #3763

    Eric White
    Keymaster

    Hi,

    Support for this variety of markup is not a feature of the HtmlToWmlConverter module. It could be possible to enhance that module to support this variety of markup, but this is not on the list of things in the near or medium future for me. You could certainly enhance the code to support this, but you would need to be familiar with writing Recursive Pure Functional Transforms (RPFT) in C#. See the following screen-cast series.

    Recursive Pure Functional Transforms Series

    Probably would be easier to directly change the markup.

    Are you familiar with the HtmlAgilityPack:

    https://htmlagilitypack.codeplex.com/

    It is a good C# API for doing this variety of stuff.

    Cheers, Eric

    in reply to: How to change Chart's MaxAxisValue ? #3762

    Eric White
    Keymaster

    Hi,

    I don’t know the specifics of the question you are asking. I have done some work with charts, in the area of setting / getting the data behind the chart, but I haven’t done any work in this area.

    Probably you know about this, but the easiest way to research Open XML markup is demonstrated in the following screen-cast:

    How to Research Open XML Markup

    In order to answer your question, I only would need to follow the procedure detailed in the above screen-cast.

    It is screen-cast #13 at the following link:

    Introduction to Open XML

    The others may be of interest too.

    Cheers, Eric

    in reply to: add character spacing for range of character in open xml c# #3761

    Eric White
    Keymaster

    Hi,

    The easiest way to research Open XML markup is demonstrated in the following screen-cast:

    How to Research Open XML Markup

    This screen-cast shows you how to find out what is the relevant markup for any specific feature of Office.

    It is screen-cast #13 at the following link:

    Introduction to Open XML

    The others may be of interest too.

    Cheers, Eric

    in reply to: OpenXML won't read file created with ZLIB 1.2.8 #3717

    Eric White
    Keymaster

    Hi,

    This is an interesting bug, and given the opacity (to me) of the internals of zip files, I am uncertain of the source of the issue.

    Which version of the Open-Xml-Sdk are you using? If you are using 2.5, then you might try 2.6, and vice versa. 2.5 and 2.6 use different libraries for reading the zip file. 2.5 uses a weird internal library that is only (afaik) used by the Open XML SDK. 2.6 uses System.IO.Compression, which is a newer, more modern implementation for ZIP.

    Cheers, Eric

Viewing 15 posts - 61 through 75 (of 253 total)