View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] aidan.heritage@virgin.net is offline
external usenet poster
 
Posts: 244
Default Late Binding Help please

On 3 Aug, 10:43, bony_tony wrote:
Hi,
I'm having a problem with a couple of lines of my code which I need to
change. I'm no programmer, so I don't really understand all this early/
late binding stuff..

I do know that I need to use late binding though, as I have a file
which is used by users with different Office versions..

My code is coming up with an error on lines;

wdApp.Selection.EndKey Unit:=wdStory
&
wdApp.Selection.PageSetup.TopMargin = CentimetersToPoints(4.8)

How can I fix this?

Cheers
Tony


A number of problems - firstly, WdStory is a Word constant, not a
global one - it's value is 6. Secondly, the := method doesn't work
outside of the host application - so the first version should be

wdApp.Selection.EndKey 6

The second one uses a Word command in the form of CentimetersToPoints
so should be expressed as...


WdApp.Selection.PageSetup.TopMargin = appwd.CentimetersToPoints(4.8)