Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Christchurch, New Zealand
    Thanked 0 Times in 0 Posts

    Send Keys - Bullets & Numbering (Office XP)

    I have a document that may contain one of three different types of numbering schemes. The user can select which numbering scheme he would like to use and it will copy the styles from a template into the current document. Each numbering scheme uses the same style names, but for each scheme the formatting is slightly different. At this stage the routine copies the appropriate styles from the source template to the destination document without problems. The indents aren't applied correctly however, and the user still then needs to go into Format, Bullets & Numbering, and press OK - WITHOUT making any changes to the gallery setting. This makes everything beautiful :-)

    I thought that I could also include this as part of my code, however the bullets & numbering dialog box doesn't appear to have any arguments. As all I want to do is press the OK button I have included the following lines in the code:

    SendKeys "~"

    If the screen update is turned off you can see the dialog display quickly, but nothing happens. If you do this manually, all the indents are correctly applied.

    Does anyone have any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 30 Times in 30 Posts

    Re: Send Keys - Bullets & Numbering (Office XP)

    Display will only show the dialog, but not apply the settings. Try .Show instead of .Display.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Melbourne, Victoria, Australia
    Thanked 279 Times in 256 Posts

    Re: Send Keys - Bullets & Numbering (Office XP)

    Hans has already pointed out the problem with .Display but you might also want to use the .Execute instead of .Show.

    Execute shouldn't display the dialog at all so you wouldn't need sendkeys to hide it again.

    I'm not sure on what showing the dialog actually does to the file though so this idea would have to be tested to see if it works for you.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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