• WSjoelfinkle

    WSjoelfinkle

    @wsjoelfinkle

    Viewing 15 replies - 1 through 15 (of 137 total)
    Author
    Replies
    • Hmm.. Do-able… I’d just need to start a new section for each such table so that the “real” header row on the Excel sheet uses a first-page header in Word, or else not paste/link the header row at all.

      Still, it’s less than optimal: a change to the Excel sheet’s structure means I still have to manually muck with headers. This is yet another place where Microsoft falls down on consistency between Office apps (top of the list includes how to put line breaks in a paragraph/cell/presentation outline item)

    • in reply to: Zombie “Serious Error – Disable Add-In” message #1283458

      Oh, and let me add that the Add-In does not cause crashes, throw errors, etc.
      Even when the add-in isn’t installed, Word displays the message!

    • in reply to: Promote Demote Keys – only H1-H9? #1241119

      I figured it out: No, the styles were defined correctly with outline numbering.

      The keystrokes Alt+Shif+Left and Alt+Shift+Right are defined to OutlinePromote and OutlineDemote.
      The toolbar buttons do DecreaseIndent and IncreaseIndent.
      All those commands are listed in Tools > Macro > Macros > All Word Commands.
      If I redefine Alt+Shift+Left and +Right to do DecreaseIndent and IncreaseIndent instead — I get the results I want.
      If you look at the online help for OutlinePromote, you’ll see it talks specifically about Heading 1-9 — not outline numbering.

      Stupid stupid Microsoft.

    • in reply to: MS Word Style List tool? #1239670

      Thanks folks. My VBA skillz are pretty mad, but I’m lazy. If somebody else had done it before me, I’d pick it up. Googling on “Microsoft Word Style Report” was extremely unsuccessful due to how common those words are, so I tried here.

      Looks like I’ll have to build it myself.

    • in reply to: MS Word Style List tool? #1239630

      Actually, the first reply was better — it could be exported to a text file.

      This is still just the style description.
      But it’s still not tabular, and in my experience, Word chooses to drop things it thinks aren’t important, like numbering info, the font size if it’s common to lots of styles, etc.

    • in reply to: MS Word Style List tool? #1239573

      Pam,
      All these years I’ve been working with Word, and I’ve never stumbled on the output from System Info.
      It’s OK, but it’s still just the description.(plus some other stuff like the base style, following style).

      What I’d really like is more of a structured table: Font (tab) Font Size (tab) Italic (tab) Bold (tab)…….
      Straight CSVs, XML, whatever, anything better than the flat text the .Description property creates, so long as every row had the same number of columns in the same places every time.

      Joel

    • in reply to: Multiple styles reset numbering on Heading? #1231677

      jscher — I think management knows it, their contractors that are doing the bulk of the work may have rose-colored glasses.

      I managed to reproduce the behavior of the styles — I was wrong that the “alternates” numbered separately within Heading 1, they numbered continuously with Heading 2, except they are centered. So re-creating the styles as “Based On” Heading 2 reproduced the behavior I wanted.

      What I found, though, is that a reset routine I’d written, that rebuilds the list templates (using named list templates to be bulletproof), reassigns all the text in the alternate styles to Heading 2 when the list template is assigned ot Heading 2. Disturbing that Word would do that without asking, as the alternate styles do not enter into it at all.

    • in reply to: Multiple styles reset numbering on Heading? #1231472

      I’ve tried copying the styles using both the Organizer for individuals, and the UpdateStyles method, neither of which appears to preserve the lists.
      There are no List Styles in the document — I believe the templates these are based on may pre-date the List Style concept (scary).

      And yes, I believe you that this could lead to instability.

      I’m asking if I can upload the file, if I can, I’ll be back here shortly.

      The customer is being very difficult — it’s a corporate merger and they’re trying to get the features of both companies’ templates to work together.
      They’re asking for a “unified” template that merely attaching to and updating styles will make everything work happy happy… no macros to clean things up. That may be impossible.

      I would advise changing the “Supportive” items to captions that capture the Heading numbering — which has its own nightmares, but one I know how to manage. But that requires running a clean-up routine after attaching the template.

    • in reply to: Selection.Style fails on table??? #1171319

      Through the assistance of a partner company of ours, I have the (lousy) answer:

      The Selection.Style method fails with error 91 if more than 50 paragraphs are selected.

      That’s lame, lame, lame.
      But at least I can test for it.

    • in reply to: Selection.Style fails on table??? #1171308

      Hi joelfinkle,

      I’m not seeing the behaviour you describe. Using the document attached to your post, I ran the following code with a variety of selections:

      Code:
      Sub Test()
      Dim oPara As Paragraph, sStyles As String
      For Each oPara In Selection.Paragraphs
      sStyles = sStyles & oPara.Style & "*"
      Next
      MsgBox Replace(Trim(sStyles), "*", Chr(10))
      End Sub

      Each time, I was able to retrieve the style names without difficulty.

      Perhaps we’d get a better idea of where the problem lies if you post your code.

      Macropod,
      The problem occurs when the entire table is selected, on Selection.Tables. I’m going to check on the Table Style issue — perhaps that’s what’s causing my problem.
      Part of my code must deal with users selecting arbitrary text — which could be the table, it could be a few random paragraphs.

      In one part of code, I apply or remove (the latter is tricky, involves a temp doc where I delete the style — you can’t just do a .font.reset or you lose bold, fonts, etc.) a character style to whatever is selected, based on whether the text is already in the character style, e.g.

      sStyle = Selection.Style ‘ Throws error
      if sStyle “My Character Style” then
      Selection.Style = “My Character Style”
      else
      RemoveStyleFromText Selection.Range, “My Character Style”
      end if

      Checking each paragraph individually is not acceptable: it may not be entire paragraphs, and I want to know if *all* of the text shares the style.
      Selection.Style ought to work, but doesn’t.

    • in reply to: MAJOR bug in KB969604? #1170546

      There is a fix to this problem — Microsoft has issued a hotfix:

      http://support.microsoft.com/kb/970942/

      It doesn’t admit to fixing this particular problem, but it does.

      The KB969604 causes Word 2007 to write utter crap into the docVar elements of the settings.xml file in the Word folder of the ZIP package. Meanwhile, the in-memory version is still fine, so you don’t discover the problem until you next open it. Needless to say, if your document variables have been crapped on already, the hot fix won’t correct them. Backup is your friend.

      The skinny on other boards is that this isn’t likely to be part of an official patch until Office 2007 SP3.

    • in reply to: VBA Project limits? #1161043

      Well, you could perhaps have one pic control and use the loadpicture command to change its picture. That way you can leave the picture control empty in design mode?

      Innnnnteresting. I hadn’t tested to see whether an empty pic control eliminated the death spiral.
      The only other downside is the need to make the pictures available in the distribution as separate files. Not a huge deal, but an annoyance (the system then needs to be able to find them — that’s the nasty part)

    • in reply to: VBA Project limits? #1160999

      Well, I got it running without constant crashes.
      The culprit was the dialog with a large background image.
      However, changing to a JPG (instead of the BMP) gave me the same result, as did creating small images for the important content (company and product logos) placed in picture controls.

      The primary symptom is that when opening the template, or creating a new doc based on the template, then going into VBA, checking the “Debug” menu would show the Compile menu item available, which is normally only available if you have made a change. Of course, choosing that menu would cause the crash.

      This was happening even rebuilding that form from scratch, after rebuilding the entire template starting with a doc created from Normal.dotm (which is pretty darn empty except for a few utility routines — no goofy styles), connecting to the references (ADO 2.8, Scripting Runtime, and a company licensing object), and importing each piece of code back in.

      The funny thing is, I have another form with picture controls on it, and it doesn’t die. The only difference I can see is that the picture control is in a frame.

      (By the way, if there’s a way to put pics in a combo box without bringing in a 3rd-party control, I’d appreciate it. Another programmer created a messy little thing using a spin control and a frame, and changing the position of the image in the frame to simulate a choice by the position)

    • in reply to: VBA Project limits? #1160700

      I’d split up the largest module in at least two modules. There is some sort of a 64k limit on module size, but it isn’t consistent. You may have hit it here though.

      I’ve done that, but I don’t think that’s the culprit (still crashing).
      The most likely suspect right now is a form with a 500+K image in its background (created by our marketing people, natch). Reloading that form, deleting the image and replacing it with smaller ones is still trouble, but I’m guessing it pegged some memory block, and there’s already trash in the project file. I’m going to rebuild that form from scratch (at least it’s relatively simple).

      If this next attempt doesn’t work, I’m throwing in the towel. Thankfully, this project is on spec, and not a dependency on an ongoing project. But I’d be a hero if I got it working.

    • in reply to: VBA Project limits? #1160663

      I’m quite confident you haven’t hit a limit on the size of the project itself. My largest project had significantly more code.

      How large is your largest module (line count)?

      Of course for userforms this method cannot be used. You could however move the code behind the forms to a notepad file as well, empty the module and then export the forms to be on the safe side.

      The largest module is 128K (about 2800 lines) in .bas form, which so far as I can tell is only a text file. That one is about 3X the size of any other .bas or .frm file
      One of the forms has a .bmp background, and is over 521K — that was one of the last things added before things went south.

      What’s so frustrating here is that there’s no indication of anything being wrong: the code is correct, there’s no warnings that I’m doing something beyond the VBA limits.

      Previous versions of this project have used a COM Add-In. I’ve been trying to back away from that because customers complain about having to run an installer will elevated privs, versus just pointing everyone at a Workgroup Template folder. But it looks like I won’t be able to add all this functionality, unless I get lucky on a rebuild this morning.

    Viewing 15 replies - 1 through 15 (of 137 total)