Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how can I print Locals window values (Word 2002 XP SR3)

    Im debugging my code & have the "Locals" window open. Is there away i can print out all the locals & their values.
    so I can view & check the values in a big picture.

    many thanks
    diana

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

    Re: how can I print Locals window values (Word 2002 XP SR3)

    As far as I know, there is no built-in support for printing the Locals window, you'd have to write it from scratch - not a task I'd fancy.

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: how can I print Locals window values (Word 2002 XP SR3)

    Hi Diana
    Occasionally when I have the urge to do something like this I use PrintKey 2000 to capture a screenshot. It's available here and <img src=/S/free.gif border=0 alt=free width=30 height=15>.
    Regards
    Don

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how can I print Locals window values (Word 2002 XP SR3)

    Further to Don's idea, the only thing that comes to mind is JOCR - <img src=/S/free.gif border=0 alt=free width=30 height=15> 84KB standalone program. It not only takes the screen capture, but uses OCR to extract the text. How accurate &/or usable it turns out you'd have to judge yourself.

    Alan

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how can I print Locals window values (Word 2002 XP SR3)

    thank you all

    yes its a large array and I wanted to print out all the values in the Immediate window.

    i could screen caputre. I guess I can write code to pipe all array values into a doc & print out

    thank you

    diana

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how can I print Locals window values (Word 2002 XP SR3)

    Ah! When you said the "Locals" window, I thought you meant the Locals window. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    The Immediate window is a different kettle of fish. I decided to have a play with this and came up with this: http://rapidshare.de/files/38505417/Immediate.zip.html.
    It's written in AutoIt and is a little tray application. It will only work if the Immediate window is undocked (as opposed to tiled) in the VBE - can't figure out why.

    If you right-click the tray icon then click "Capture", the program waits until the Immediate window has the focus (click on it anywhere to give it the focus). The dialog appears saying that the text content has been copied to the clipboard and offers the option to clear the contents of the Immediate window. Repeat as needed then use the Exit option to terminate the tray app. That's about it. Hope it works OK for you.

    BTW, AutoIt has been used to write malicious scripts, so some AV apps flag all AutoIt-based apps as threats. Hope yours isn't one of them.

    Alan

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

    Re: how can I print Locals window values (Word 2002 XP SR3)

    > When you said the "Locals" window, I thought you meant the Locals window.

    Me too... <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how can I print Locals window values (Word 2002 XP SR3)

    i just re-read the post, I accidentally typed Immediate, I meant Locals window

    my apologies <img src=/S/drop.gif border=0 alt=drop width=23 height=23>

    diana

  9. #9
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: how can I print Locals window values (Word 2002 XP SR3)

    > When you said the "Locals" window, I thought you meant the Locals window.

    Is there an inside joke here? I don't understand any difference. <img src=/S/igiveup.gif border=0 alt=igiveup width=31 height=23>
    Regards
    Don

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

    Re: how can I print Locals window values (Word 2002 XP SR3)

    See <post:=693,316>post 693,316</post:> - the subject mentions Locals and the body "I wanted to print out all the values in the Immediate window". Alan and I assumed that Diana had originally made a mistake and intended a question about the Immediate window but wrote Locals instead. It turned out that we were wrong - "Immediate" was a mistake.

    The Locals window and the Immediate window are not the same - take a look at the View menu in the Visual Basic Editor - there are separate menu items for them.

    The Locals window can (only) be used while debugging - if you're single-stepping through a Sub or Function, the Locals window displays the value of variables declared within the Sub or Function (or in the module)

  11. #11
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: how can I print Locals window values (Word 2002 XP SR3)

    Thank you.
    Regards
    Don

  12. #12
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how can I print Locals window values (Word 2002 XP SR3)

    Have you ever tried to figure out how that Locals window is composed? I can't fathom it. There are no handles visible to any of the regions/controls??? that display the output EXCEPT when you select one of the variable values. Then just that selection appears as a window control, but I still can't extract the text in it. Unselect it and it "disappears". Trying to get a handle on any other region or text seems impossible. How on Earth has this thing been cobbled together?

    Alan

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

    Re: how can I print Locals window values (Word 2002 XP SR3)

    Sorry, I don't understand your description, but I don't know how to extract anything from the Locals window anyway, so it doesn't matter.

  14. #14
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how can I print Locals window values (Word 2002 XP SR3)

    My description was (trying to describe) the Locals window in terms of the window handles (child windows, controls etc.) visible to the system. As I said, there's nothing there that's visible except when a selection is made as described. I was able to easily "hack into" the Immediate window via this route and build the little capture program I mentioned in a previous post. But no luck with Locals. <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    Alan

  15. #15
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: how can I print Locals window values (Word 2002 XP SR3)

    Are you using Spy++ for this?
    Regards,
    Rory

    Microsoft MVP - Excel

Page 1 of 2 12 LastLast

Posting Permissions

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