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

    API - SendMessage (OfficeXP SP3)

    Edited by HansV to provide link to post - see <!help=19>Help 19<!/help>

    HI

    Does anyone know how the SendMessage API works.

    It was suggested that I use the SendMessage API to toggle the checkbox for my Print to File issue>>>see post clear Print to File setting (Office XP SP3)

    many thanks diana

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

    Re: API - SendMessage (OfficeXP SP3)

    You can find some info here and here, but I dont know how that will help you. To toggle the check box in the dialog using SendMessage, you'd have to display the dialog (which you didn't want) and to know the window handle of the check box (which I don't know how to get).

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

    Re: API - SendMessage (OfficeXP SP3)

    thanks

    yes i dont want to display the dlg.

    the suggestion was this....
    'I hate to say it, but I've never found a satisfactory way to deal with that setting.
    It seems utterly unreachable through any sort of elegant means. The one thing a
    person might do, is set a hook to watch for creation of the window (see my MovedMsg
    sample), iterate the child windows of the dialog, and toggle the checkbox through
    SendMessage. Very, very messy.'

    so i dont know how im going to sort it out <shrug>
    diana

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

    Re: API - SendMessage (OfficeXP SP3)

    Yuck! I certainly don't know how to do that, but there are some Loungers who are pretty good with that kind of thing, so who knows... <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

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

    Re: API - SendMessage (OfficeXP SP3)

    hey ...if it resolves my issue...then it will do... :-)

  6. #6
    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: API - SendMessage (OfficeXP SP3)

    Since you're considering writing a procedure that would run every time the user invokes FilePrint or FilePrintDefault, you could instead write replacement macros that call the dialog and use SendKeys to clear the checkbox. Of course, it might be difficult to keep track of who set the checkbox the last time: your macro or the user? Would people mind if the default was to clear the box? Hmmm...

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

    Re: API - SendMessage (OfficeXP SP3)

    how would i do that? ie sendKeys

    another internal system when it runs > in the background calls & opens up Word to do its processing & then users the Word print dialog box to print. Its here the Print to File dialog box is appearing. When the Print to File dlg appears it interferes in the process & slows the other system down.

    In Word each time the Print dlg is called I turn off 'Print to File', therefore I can control it in Word. However when another system calls Word Print the 'Print to File' dlg appears. & im wanting to clean this up.

    any ideas Diana

  8. #8
    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: API - SendMessage (OfficeXP SP3)

    I gather you don't have the ability to insert SendKeys into the code of the other system, or otherwise change its code. Sorry, I did not put all the pieces of the problem together. And if your other system somehow is Executing (not displaying) the print dialog and arriving immediately at the dialog to specify a file name, I can't think of a means to check the box.

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: API - SendMessage (OfficeXP SP3)

    For an example that uses SendMessage, see http://www.standards.com/index.html?...rojectPassword.
    Shows how to get handles.

    There's oodles of examples at th MSFT MSDN web site.

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: API - SendMessage (OfficeXP SP3)

    the techniques used in the article i mentioned in another post in this read may be used ti solve your problem.

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

    Re: API - SendMessage (OfficeXP SP3)

    yes the other system is so old you cant code in it as its very basic syntax & doesnt accomodate for the printing options.

    ...mmm to be continued....

  12. #12
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: API - SendMessage (OfficeXP SP3)

    Ah, one of those holy grails! Here's how to reset the Print to File checkbox:

    Application.PrintOut Range:=wdPrintRangeOfPages, Pages:="0", PrintToFile:=False

    Just make sure that at least one document is open!

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

    Re: API - SendMessage (OfficeXP SP3)

    Nice idea, but if you've set page numbering in the active document to start at 0, you'll print the first page of the document...

  14. #14
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: API - SendMessage (OfficeXP SP3)

    Oops! You're right. And envelopes always have page number zero.
    Ah well...

  15. #15
    Star Lounger
    Join Date
    Jan 2001
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: API - SendMessage (OfficeXP SP3)

    Ok, a kludge then.

    Documents.Add
    Application.PrintOut Range:=wdPrintRangeOfPages, Pages:="0", PrintToFile:=False
    ActiveDocument.Close

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
  •