View Single Post
 
Old 12-23-2011, 12:45 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,384
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi tinfanide,

This issue is that, when using late binding, the calling app has no access to the called app's object model until the code is compiled. In this case, Excel has no way of knowing what wdBorderTop or wdLineStyleSingle, for example, are.

FWIW, if you'd prefer to leave the parameters unchanged, you could declare them beforehand with code like:
Const wdBorderTop As Long = -1
Const wdLineStyleSingle As Long = 1
This has the advantage that expressions like:
.Borders(wdBorderTop).LineStyle = wdLineStyleSingle
are much easier to interpret than:
.Borders(-1).LineStyle = 1
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote