Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Nov 2003
    Posts
    61
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Security Patch causing me fits! (XP and VBA)

    I have some VBA code that worked fine in XP until the latest security patch (KB830346).

    It is designed to drop a text file into a new document and apply basic footnote and text styles to it.

    Now this section seems to be giving me fits. It is supposed to go into the footnotes and start working, but instead it stays in the text and acts like the footnote calls in the text are the footnotes. I don't see a reason for it not to function normally, if it was functioning before.

    It occurs to me that I may have a security setting that causing the macro to be disabled or otherwise corrupted. I have the security set to "low", but do not have a signature on it.

    Any help is much appreciated.

    Rem *** Set module variables to be used later ***
    BText "Looking for notes"
    If ActiveDocument.Footnotes.Count >= 1 Then

    Rem *** Footnotes ***
    ActiveWindow.View.SplitSpecial = wdPaneFootnotes
    NoteCount = ActiveDocument.Footnotes.Count
    FndFound = 1
    Note = "^f"
    intParaCount = ActiveDocument.StoryRanges(wdFootnotesStory).Parag raphs.Count
    With ActiveDocument.Footnotes
    .Location = wdBottomOfPage
    .NumberingRule = wdRestartContinuous
    .NumberStyle = wdNoteNumberStyleArabic
    .StartingNumber = 1
    End With
    ElseIf ActiveDocument.Endnotes.Count >= 1 Then

    Rem *** Endnotes ***
    ActiveWindow.View.SplitSpecial = wdPaneEndnotes
    NoteCount = ActiveDocument.Endnotes.Count
    FndFound = 0
    Note = "^e"
    intParaCount = ActiveDocument.StoryRanges(wdEndnotesStory).Paragr aphs.Count
    With ActiveDocument.Endnotes
    .Location = wdEndOfDocument
    .NumberingRule = wdRestartContinuous
    .NumberStyle = wdNoteNumberStyleArabic
    .StartingNumber = 1
    End With
    Else
    Rem *** No Notes ***
    FndFound = 3
    End If
    If FndFound = 3 Then GoTo SkipNotes
    -----

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Security Patch causing me fits! (XP and VBA)

    I have installed KB 830346. I copied your code into a module and tested it on a document with footnotes, and on another document with endnotes. The code worked OK in both cases, so I fear that your problems have another cause.

    BTW, I wouldn't set macro security to Low, Medium is better - you won't be executing a macro without even knowing it.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Security Patch causing me fits! (XP and VBA)

    You did not respond to my reply from yesterday to your message on the Word board. Here it is again:

    <UL>Re: Security Patch Problems (Word XP)
    Post: <post#=316111>post 316111</post#>
    25-Nov-03 09:24

    If you single-step through the macro, can you see whether it is ignoring a command (e.g., to view the Footnote pane), or perhaps has changed the way it switches among views so that the command no longer works in the new context? I can't think of any other way to narrow down what might be going wrong.[/list]Try placing a Stop statement before "Rem *** Footnotes ***" and when the de###### comes up, resize the window so you can watch what is happening in the document while single-stepping.

  4. #4
    Star Lounger
    Join Date
    Nov 2003
    Posts
    61
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Re: Security Patch causing me fits! (XP and VBA)

    Actually I had tried that. That was the first thing I did.

    In it's current incarnation my VBA doesn't recognize Stop. It runs right over it.

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Security Patch causing me fits! (XP and VBA)

    Really? That suggests that there are no footenotes in the document, or there is some confusion about which document is ActiveDocument, or that entire part of the code is being bypassed. If you insert a Stop much earlier, can you see what's going on? Do you have a sample document you'd want to post?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •