Borders and Shading Built-in dialog box 
Author Message
 Borders and Shading Built-in dialog box

The ApplyTo argument in the wdDialogFormatBordersAndShading dialog box
doesn't appear to return a value.

This means I can't determine whether the user intends to change border
settings for the entire document, a section, or for the first page only of a
section.

Am I missing something or is this a bug?

Mike Barton



Sat, 20 Sep 2003 22:29:38 GMT  
 Borders and Shading Built-in dialog box
Hi Mike,

Quote:
> The ApplyTo argument in the wdDialogFormatBordersAndShading dialog box
> doesn't appear to return a value.

> This means I can't determine whether the user intends to change border
> settings for the entire document, a section, or for the first page only of
a
> section.

> Am I missing something or is this a bug?

You're missing something ;-)

Try this:

-------------------------------------------------------------

With Dialogs(wdDialogFormatBordersAndShading)
    If .Display = -1 Then
        Select Case .WhichPages
            Case 0
                MsgBox "Whole Document"
            Case 1
                MsgBox "This Section"
            Case 2
                MsgBox "This Section - first page only"
            Case 3
                MsgBox "This Section - all except first page"
        End Select
    End If
End With

-------------------------------------------------------------

Hope this helps.
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.



Sat, 20 Sep 2003 23:08:56 GMT  
 Borders and Shading Built-in dialog box
...and not just my marbles.

Thanks. I now remember I had realised that the Apply to combo returns the
WhichPages argument but I am easily confused.

Which begs the question "what does the Applyto argument refer to"?

Many thanks.

Mike Barton


Quote:
> Hi Mike,

> > The ApplyTo argument in the wdDialogFormatBordersAndShading dialog box
> > doesn't appear to return a value.

> > This means I can't determine whether the user intends to change border
> > settings for the entire document, a section, or for the first page only
of
> a
> > section.

> > Am I missing something or is this a bug?

> You're missing something ;-)

> Try this:

> -------------------------------------------------------------

> With Dialogs(wdDialogFormatBordersAndShading)
>     If .Display = -1 Then
>         Select Case .WhichPages
>             Case 0
>                 MsgBox "Whole Document"
>             Case 1
>                 MsgBox "This Section"
>             Case 2
>                 MsgBox "This Section - first page only"
>             Case 3
>                 MsgBox "This Section - all except first page"
>         End Select
>     End If
> End With

> -------------------------------------------------------------

> Hope this helps.
> ibby

> Please post replies or follow-ups to the **newsgroup** so that
participants
> may benefit or contribute.



Sat, 20 Sep 2003 23:28:10 GMT  
 Borders and Shading Built-in dialog box

Quote:
> Which begs the question "what does the Applyto argument refer to"?

ApplyTo returns the selection in the ApplyTo box in the "Borders" or
"Shading" tab. It actually returns the index of the selected item, the first
item being 0. If you haven't selected any text in the document, there is
only 1 item in the dropdown - "Paragraph" - so it will always return 0. If
you select some text in the document, there will be 2 items in the dropdown:

"Text" - returns 0
"Paragraph" - returns 1

--
Hope this helps.
ibby

Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.



Sat, 20 Sep 2003 23:54:04 GMT  
 Borders and Shading Built-in dialog box
Thank you for clearing this up.

Is this documented anywhere or is this just the product of (your) hard
graft?

Mike


Quote:

> > Which begs the question "what does the Applyto argument refer to"?

> ApplyTo returns the selection in the ApplyTo box in the "Borders" or
> "Shading" tab. It actually returns the index of the selected item, the
first
> item being 0. If you haven't selected any text in the document, there is
> only 1 item in the dropdown - "Paragraph" - so it will always return 0. If
> you select some text in the document, there will be 2 items in the
dropdown:

> "Text" - returns 0
> "Paragraph" - returns 1

> --
> Hope this helps.
> ibby

> Please post replies or follow-ups to the **newsgroup** so that
participants
> may benefit or contribute.



Sun, 21 Sep 2003 00:22:30 GMT  
 Borders and Shading Built-in dialog box

Quote:

> Thank you for clearing this up.

> Is this documented anywhere or is this just the product of (your) hard
> graft?

The Dialog arguments are very poorly documented. You've just got to get in
there and play around with them.

---
ibby



Sun, 21 Sep 2003 00:47:14 GMT  
 Borders and Shading Built-in dialog box
Hi Mike,

The best available source of information on Word's built-in dialogs is
actually the WordBasic help file from Word 95! The parameters of the old
WordBasic commands are almost all the same as the dialog box arguments in
VBA.

Unfortunately this doesn't cover dialogs that have been added or changed
since Word 95, but a surprisingly large number of them are still the same.

After much badgering, a few months ago I persuaded MS to make the WordBasic
help file available online. You can find it at

http://www.microsoft.com/downloads/release.asp?ReleaseID=26572

You may also find the following article of interest

Getting help with calling Word's built-in dialogs using VBA
http://www.mvps.org/word/FAQs/MacrosVBA/WordDlgHelp.htm

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email


Quote:
> Thank you for clearing this up.

> Is this documented anywhere or is this just the product of (your) hard
> graft?

> Mike



> > > Which begs the question "what does the Applyto argument refer to"?

> > ApplyTo returns the selection in the ApplyTo box in the "Borders" or
> > "Shading" tab. It actually returns the index of the selected item, the
> first
> > item being 0. If you haven't selected any text in the document, there is
> > only 1 item in the dropdown - "Paragraph" - so it will always return 0.
If
> > you select some text in the document, there will be 2 items in the
> dropdown:

> > "Text" - returns 0
> > "Paragraph" - returns 1

> > --
> > Hope this helps.
> > ibby

> > Please post replies or follow-ups to the **newsgroup** so that
> participants
> > may benefit or contribute.



Sun, 21 Sep 2003 01:28:40 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Mapping Borders and Shading from XL to WD

2. Hide field shading and border (in Word Viewer)

3. Creating a gradual shading border...

4. Problems Displaying Built-in Dialog Box

5. Clearing/Setting a check box with SendKeys in built-in dialog

6. Problems Displaying Built-in Dialog Box

7. Built-in dialog box

8. Built in Dialog Boxes

9. Using built-in EditFind dialog box

10. building better dialog boxes

11. building better dialog boxes

12. Select Directory dialog box like Comm Dialog Box

 

 
Powered by phpBB® Forum Software