• WSDaveW

    WSDaveW

    @wsdavew

    Viewing 13 replies - 1 through 13 (of 13 total)
    Author
    Replies
    • in reply to: ‘New’ doc dialog? (Wd 2002) #745309

      Thanks Hans, I should have thought of that. (Probably would have, eventually; but assumed there would be a checkbox somewhere to uncheck, after which all would behave as it used to).
      It’s just so much like when your local supermarket rearranges all the shelves just when you’ve got used to where things are… bash

    • in reply to: font.hidden property, tables and code (2000) #694272

      Thanks HansV, I’ve printed off Dave Rado’s article (I’ve found his articles to be v. useful in the past), and it looks like there’s stuff I can play with here that should increase speed. There’s certainly a suggestion that if I select a cell in column 1, then select the column, and work with the cells in the selection, that should be faster. I’ll try some of these things out and post an update when I see what happens!
      (Unfortunately the best time for me to concentrate on this sort of stuff is on my machine at home – when *anything* runs pretty fast… but then I have to bring it all back in to work, whereupon I find out what’s genuinely fast and what isn’t!!)

    • in reply to: font.hidden property, tables and code (2000) #694024

      (Edited by jscher2000 on 16-Jul-03 15:47.

       and 

      markup added around code snippet to preserve indenting.)

      Hi guys:
      Though the code for applying/retrieving the hidden property is now sorted, after a couple of days not working with the document I’ve now gone back in and found that populating the listbox in the first place is running unbelievably slowly.
      Here’s an idea of the structure of the table, then I’ll show the code I’ve got populating the listbox: can anybody see how I might make it run *way* faster?
      Table has 3 columns. All the text in cols 2 and 3 is formatted with a style called “response”. In the first column, some rows have text in “Matrix 1” style (these are ‘section headings’ within the table), others have text in “Matrix 2” style (these are items under the headings). Matrix 1 and Matrix 2 styles are outline numbered (1, 2, 3 for Matrix 1; 1.1, 1.2 etc for Matrix 2).
      First part of the code for populating the listbox (slow running part):

      Dim iRow As Row, i As Integer, j As Integer, aRange As Range
      i = 1
      j = 1
      With ActiveDocument.Tables(1)
          For Each iRow In .Rows
          Set aRange = iRow.Cells(1).Range
          aRange.TextRetrievalMode.IncludeHiddenText = True
              If aRange.Paragraphs(1).Style = "matrix h1" Then
              LstSections.AddItem Left(aRange.Paragraphs(1).Range.Text, _
                  Len(aRange.Paragraphs(1).Range.Text) - 2)
              LstSections.List(j - 1, 1) = i
              j = j + 1
              End If
              i = i + 1
          Next iRow
        '(more code to SELECT items in the list if the corresponding part 
        ' of the table is not formatted as hidden text, then: )
      End With

      (Note: I’m chopping off the last two characters in each range because it’s in table cells and I don’t want the para mark or cell division character, etc.)

    • in reply to: font.hidden property, tables and code (2000) #691642

      Yes; thanks to you both for these inputs. I think I’ve got a working solution now: I’ve added a second column to the listbox, and put in it the row number where the specified style occurs. So if the style is on rows 1, 12, and 22 (for example) the listbox has items:
      blah blah blah | 1
      more blah blah | 12
      yet more blah | 22. (etc.)
      …Then according to whether the item is checked or not I can set rows 1-11, 12-21 or 22-.count as hidden or not hidden.
      Because I’m looking at the styles now, this will still work if users add their own “sections” to the table (which it didn’t when I was relying on bookmarks).

    • in reply to: font.hidden property, tables and code (2000) #691148

      Aha; thanks HansV, I didn’t know that.
      Yes, I’ve checked the paragraphs.count for each of the bookmarked ranges in the table, and – you’re right – the ones that give trouble have 70 paragraphs in them.
      So perhaps what I need to do is *not* have a bookmark that encompasses the whole range to be considered, but one that marks the start, another that marks the end, and have the code just ask about the .hidden property of the starting bookmark, then work with a range that’s defined as eveything between the two?
      Heck: thinking as I type, since the first row of each range (and only the first – so at maximum 3 paragraphs, one for each cell in that row) is formatted with a specific style, maybe I should find some way to scrap the bookmarks altogether and identify the ranges according to style, and determine the .hidden property as it’s applied to each occurrence of that style. Hmm…

    • in reply to: activating new document (wd2000) #653139

      Strangely, I now can’t get it to replicate the problem – works fine now! (Though it WAS doing it all the time… must’ve been some specific set of circumstances, but I’m blown if I can work out what). Hmm… Anyway, no I wasn’t running TweakUI on my home machine either, but I’ve kept hold of that code snippet in case it leaps up again. Sorry to have troubled you guys with a problem that seems to have gone away of its own accord!
      (If only they were all like that, huh?)

    • in reply to: activating new document (wd2000) #652190

      I’ve just tried the code on a different machine: at work we’re on Win2000 (definitely no TweakUI!), and it does what it’s supposed to, the way it’s expected to (which is the main thing, really, since it’ll be used at work when it’s all sorted out). On my machine at home (which was exhibiting the problem) I have WinXP, and possibly (I can’t recall offhand) TweakUI. I’ll have a look into it.
      In the meantime, I’ll also have a go with Gary’s code, see if that makes a difference.
      Thanks guys, I’ll report back with the outcome (one way or the other!)…

    • in reply to: activating new document (wd2000) #651567

      The code’s running from a Word global template.
      To create the document:
      Dim DocReport as Document
      (…code…)
      Set DocReport = Documents.Add(Template:=ThisDocument.FullName) ‘note I didn’t set visibility either way

      Later, to activate the document:
      DocReport.activate

      No, I didn’t turn off screenupdating.
      HTH

    • in reply to: Default Paragraph Style (97 latest updates/patches) #642700

      Reading this thread with interest, I wondered: is this problem related at all to the one I experience? – Namely, that if I have some text (either on the page or in a text box), and I cut it to the clipboard, then do “paste as picture”… it often pastes as a “picture of some TNR text” even if my cut text was in Arial (which it usually is).

    • in reply to: document_open macros when opened via intranet (wd2000) #597438

      Thanks Jefferson:
      I’ll study the threads about vbscript solutions when I have time & opportunity to really take them in (!) but the method from the KB article seems to do the trick so I might go with that, at least as an interim measure.
      (Of course, ‘other weirdness’ includes that the users might get frustrated by the lack of their familiar Word editing toolbars etc.: it’ll at least prompt ’em to save the document locally and get out of the browser. hmmm…)

    • in reply to: Updating all fields in all storyTypes (Word 2000) #581094

      Yes, doing a quick bit of testing it looks like you’re right, Stuart.
      I’ll rip out those extra lines since all they seem to be doing is slowing things down a little. Odd, i’m sure I had them in there for a reason, just can’t for the life of me think what it was… confused
      Another thing spotted during testing: switching views from Page to Normal and then back SEEMS to force Word to update all fields without us manually cycling through them: can anyone confirm that this holds true for multiple-sections, etc. etc. (could be a useful sideways solution?)

    • in reply to: Updating all fields in all storyTypes (Word 2000) #580744

      Hmm, as an aside, I’ve had this requirement for a long while too (you’d think updating all fields would be built in, like toggle all fields is, but there we go…), and the code I cobbled together (probably from stuff out of this MB or otherwise Woody’s books) was:

      Public Sub UpdateAllFields()
      If Not Documents.Count = 0 Then
      Dim aStory As Range
      For Each aStory In ActiveDocument.StoryRanges
      While Not (aStory Is Nothing)
      aStory.Fields.Update
      Set aStory = aStory.NextStoryRange
      Wend
      Next aStory
      End If
      End Sub

      This seems to have been sufficient for my needs: does it miss out some fields and I just failed to notice them? (I must admit that since my docs are single-sided I have fewer encounters with the multiple versions of headers & footers)…

      dtw

    • in reply to: Word (97 SR2) #580215

      The square dot is quite useful actually: it’s an indication that the paragraph has one of the following applied (either manually or from its underlying style) to it: (a) keep lines together, ( keep with next, © page break before.
      Like most formatting characters, you’re usually better off learning to appreciate it for what it is than wanting to get rid of it.
      HTH

    Viewing 13 replies - 1 through 13 (of 13 total)