Setting wdBorderLeft, wBorderRight LineStyle to wdLineStyleNone not working

I

Ivan Nue

I am executing the following commands from Visual Basic automating
Word to remove the border of the bottom most cell in a table, but only
the bottom border actually gets set to wdLineStyleNone. This same
code, when run from VBA in a macro works. Why could this be
happening?


<at this point the bottom cell is selected>

With oWordApp.Selection.Cells

.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False

End With


Any insight would be appreciated.

Thanks,

Ivan Nue
 
W

Word Heretic

G'day (e-mail address removed) (Ivan Nue),

coz the dialog cheats via custom code you need reproduce

(e-mail address removed) (Ivan Nue) was spinning this yarn:
I am executing the following commands from Visual Basic automating
Word to remove the border of the bottom most cell in a table, but only
the bottom border actually gets set to wdLineStyleNone. This same
code, when run from VBA in a macro works. Why could this be
happening?


<at this point the bottom cell is selected>

With oWordApp.Selection.Cells

.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders.Shadow = False

End With


Any insight would be appreciated.

Thanks,

Ivan Nue

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

Replies offlist may require payment.
 
I

Ivan Nue

Wow. I don't understand what you've written here. I must be missing something.

Thanks in advance,

Ivan
 
W

Word Heretic

G'day (e-mail address removed) (Ivan Nue),

Word cheats on many objects and dialog functions. I am guessing
something to do with your shortcuts has done it.

Firstly, I'd be chucking in a break point at this line and examining
Selection to make sure you have selected a table. Maybe Selection is
playing up being driven remote.

Maybe a DoEvents just before this code to let Word get settled down.

Is the target document visible? I have had probs with hidden documents
and selection before.

just guessing bro


(e-mail address removed) (Ivan Nue) was spinning this yarn:
Wow. I don't understand what you've written here. I must be missing something.

Thanks in advance,

Ivan

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top