• WSAndrew77

    WSAndrew77

    @wsandrew77

    Viewing 15 replies - 1 through 15 (of 578 total)
    Author
    Replies
    • in reply to: Hide who makes changes in track changes (Word 2000) #989845

      See post 441,718 for info on how to modify the identity of the reviewer using RTF.

      HTH,

    • in reply to: Styles (2003 XP) #985337

      Rather than just remove the buttons that apply directy formatting, I “re-educate” the buttons to apply styles instead. For example, when an author presses “I” (or Ctrl-I), one of several character styles is applied, based on context (unless they’ve selected multiple paragraphs, in which case nothing happens). Same thing for Bold, Bullets, Numbering, Indent, etc. User education is difficult — relatively speaking, button education is much easier … grin

    • in reply to: Cross-reference between 2 documents (1) #982758

      Thanks, Jefferson!

    • in reply to: Cross-reference between 2 documents (1) #982706

      As someone who has implemented this in code, I’ll say it ain’t easy, but it can be done. If you’re looking at making a ton of xrefs, it can be worth it. I for one hate that infernal, tiny cross reference dialog.

      Hack 44 (“Hack More Flexible Cross Referencing”) in my book (see signature below) covers how to implement your own cross reference dialog. We use a more complex version of that code (which includes a pulldown to choose external docs) in our authoring template.

    • in reply to: Reference Book or Manual (Word 2003) #980220

      It’s not really a reference, but there’s plenty of stuff on working around problems in Word Hacks. I’m obviously partial grin, but I honestly refer to it myself regularly. It’s squarely aimed at intermediate to advanced users, especially those willing to get their hands a little dirty under the hood.

      Cheers!

    • in reply to: Printing XPath from Word (2003 sp1) #979132

      Hi Barb,

      Thanks for posting the sample, it really helped me understand the files you’re working with. Not XSLT, but certainly influenced by it!

      I’ve attached a zip file containing two documents: “list-xpaths.xsl” and “xpaths.txt”. I created the second file, “xpaths.txt”, by applying the first as a transformation to the document you posted.

      To do the same, save the “list-xpaths.xsl” file to your computer, and open up one of your docs. Choose Save As XML, and then check the box marked “apply transform”. Press the button labeld “transform”, and navigate to the “list-xpaths.xsl” file. In the File Name box, type “docxpaths.txt” (including the quotes, or you’ll get an .xml extension), and finally press “Save”.

      Note that the title bar of the open doc will now (wrongly) display “docxpaths.txt”. Just close the open doc, then choose File -> Open, and open the docxpaths.txt file you just created.

      This is just a very simple listing of the values of the “test” and “select” attributes. It’d certainly be possible to actually format this stuff out as an actual Word doc, perhaps in a table or something. For more on generating WordprocessingML with XSLT, see chapter 10 of my book (can’t resist a chance to drop in a plug).

    • in reply to: Printing XPath from Word (2003 sp1) #979123

      Hi Barb,

      The “Word .xml” documents you’re looking at are xslt stylesheets. (or at least also have elements named “for-each” with attributes named “select” which have values that are xpath expressions). Can you post one of these “Word .xml” documents?

    • in reply to: Printing XPath from Word (2003 sp1) #979116

      If you just want to do things like list all the xpaths matched by for-each elements in an xslt stylesheet, I’d recommend xmlstarlet, a free command-line utility for processing/querying xml documents, available at: http://xmlstar.sourceforge.net/%5B/url%5D.

      For example, if you had a stylesheet “foo.xsl”, and you wanted a list of all the xpaths used by for-each elements, you’d use the following command:

      xml sel -t -m "//xsl:for-each/@select" -v "." -n foo.xsl

      Not sure how comfortable you are with xml/xslt, but I’ve found xmlstarlet to be a lifesaver.

    • in reply to: Printing XPath from Word (2003 sp1) #979111

      Hmm. As best I can tell, you’re viewing an XSLT stylesheet from within Word, which is why the value of the “select” attribute in the “for-each” element is an xpath expression. I had thought perhaps Word was dynamically generating the xpath for elements/attributes on the fly, but it just displays the value of the attribute, which in this case is an xpath expression.

      Are you saying you’d like to view all of the xpath expressions used in the xslt stylesheet you’re viewing? Have you considered viewing the XSLT stylesheet from a plain text editor rather than from Word?

    • in reply to: Printing XPath from Word (2003 sp1) #979105

      Ah, thank you very much for the screenshots, that helped quite a bit.

    • in reply to: Printing XPath from Word (2003 sp1) #979095

      I’m a bit unclear about your request. Please elaborate on what you mean by “mapping xpath”. I’m also quite confused by, “In Word, the XPath can be viewed in the attributes of the XML tags”.

      Are you referring to WordprocessingML?

    • in reply to: Selection in VBA (Word 2003) #976051

      Hi Rich,

      As usual, Hans is spot on with his solution. I also thought I’d post the following utility function, which collapses both end of the current selection, de-selecting both leading and trailing spaces,as well as paragraph marks (helpful when you select a word at the end of a paragraph). I use it quite a bit throughout some of my templates.

      HTH,

      Function ChompSelection(ByRef sel As Selection)
      If sel.Range.Characters.Count = 1 Then Exit Function
      sel.MoveStartWhile cset:=(Chr$(32) & Chr$(13)), Count:=sel.Characters.Count
      sel.MoveEndWhile cset:=(Chr$(32) & Chr$(13)), Count:=-sel.Characters.Count
      End Function
      
    • in reply to: Track Changes – can you change the author (wordXP SP3) #975527

      See post 441718 .

      HTH!

    • in reply to: Wildcards search excluding a specified character (Word97) #969706

      Hi Dale,

      Word’s wildcards are more powerful than most people realize, but they’re still rather limited. That kind of match is a bit more than it can handle on its own. The best you could probably do natively is to use some VBA to examine the matches to the original pattern to see if they include the substring, then act based on that.

      Complex pattern matching in strings is not an uncommon task, and there are many tools far better suited for it than Word. You’re even further limited by still using Word 97. With Word 2000 and up, you have access to the VBScript RegExp object, which gives you access to a full Regular Expression (string-pattern matching) engine:
      http://www.windowsdevcenter.com/pub/a/wind…dex.html?page=4%5B/url%5D

      Generally, when complex patterns like this come up, I turn to other tools like Perl or Ruby:
      http://www.perl.com/pub/a/2005/05/26/word_control.html%5B/url%5D

    • in reply to: Shortcut to insert cross reference (Word XP) #968727

      If you search the VBA help for “InsertCrossReference”, the first result gives you your answer.

      sel.InsertCrossReference _
                referencetype:=wdRefTypeHeading, _
                referencekind:=wdNumberNoContext, _
                insertashyperlink:=true, _
                referenceitem:=k
      
    Viewing 15 replies - 1 through 15 (of 578 total)