Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

Question About Borders and Shading Dialog Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JBNewsGroup - 10 Apr 2005 07:42 GMT
Hi,

In a WORD2000 macro I have the following code:

With Dialogs(wdDialogFormatBordersAnd Shading)
      .Display
      TBorderStyle = .TopStyle
      LBorderStyle = .LeftStyle
      BBorderStyle = .BottomStyle
      RBorderStyle = .RightStyle
End With

I am not using "Show" as further down the macro I apply the selections to a
Shape which may not be selected or drawn at the time I use the Borders
dialog.

Question:

When the Dialog opens the Default setting is "None".  How do you set the
Default setting to "Box" so that "Box" is selected when  the Dialog opens?

Also, does anyone know what the arguments TL2BRBorder, etc are?

Any help is appreciated.

Thanks in advance for any replies.

Jerry Bodoff
Jay Freedman - 10 Apr 2005 16:24 GMT
Hi Jerry,

The "Setting" column down the left side of the dialog doesn't have a
corresponding argument. Each button there is a "preset" for a
collection of border styles, purely for use in the UI. The only way to
get it selected on open is to fake the Alt+X keystroke by putting the
statement

 SendKeys "%x"

before the .Display statement.

If the Selection is in a table when the dialog opens (so the Apply To
box is set to either Table or Cell), buttons become visible to insert
the two diagonals: top left to bottom right (TL2BR) and top right to
bottom left (TR2BL). Each of those has a style, color, and weight (but
I don't know what the "border" value means).

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org

>Hi,
>
[quoted text clipped - 24 lines]
>
>Jerry Bodoff
JBNewsGroup - 10 Apr 2005 20:24 GMT
Hi Jay,

Thanks for your response.  I will put in the SendKeys statement.

I assume that I could use SendKeys for any condition similar to this.

Jerry Bodoff
> Hi Jerry,
>
[quoted text clipped - 47 lines]
> >
> >Jerry Bodoff
Jay Freedman - 10 Apr 2005 22:07 GMT
Hi Jerry,

In theory, yes, you can use it. In practice, SendKeys has a reputation
for flakiness. Sometimes the keystrokes go off into the ether, and
sometimes they get routed to the wrong window. It often doesn't work
in single-step mode (F8) in the editor but the same code will work if
you just launch the macro (F5).

You're generally safe if the SendKeys is *immediately* followed by the
.Show or .Display statement, which is best assured by using the colon
as a statement separator like this:

  With Dialogs(wdDialogWhatever)
      SendKeys "%a" : .Display
  End With

I also try to keep the number of keystrokes in the SendKeys argument
to the bare minimum. Sacrificing a chicken under a full moon may help,
too. :-)

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org

>Hi Jay,
>
[quoted text clipped - 56 lines]
>> >
>> >Jerry Bodoff
JBNewsGroup - 11 Apr 2005 05:44 GMT
Hi Jay,

Thanks for your comments.  It works fine.

Also, the "chicken ritual" helped.

Jerry Bodoff
> Hi Jerry,
>
[quoted text clipped - 81 lines]
> >> >
> >> >Jerry Bodoff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.