• Send Keys – Bullets & Numbering (Office XP)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Send Keys – Bullets & Numbering (Office XP)

    Author
    Topic
    #415704

    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 “~”
    Dialogs(wdDialogFormatBulletsAndNumbering).Display

    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?

    Viewing 1 reply thread
    Author
    Replies
    • #927724

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

    • #927734

      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.

    Viewing 1 reply thread
    Reply To: Send Keys – Bullets & Numbering (Office XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: