Re: Late Binding Help please



Thanks for that.
For the line;
wdApp.Selection.PageSetup.TopMargin = appwd.CentimetersToPoints(4.8)
It is saying an Object is required. How do I get round this? Dim
whatever as Object??? I'm guessing...

I'm also having problems with the lines;
wdApp.Selection.MoveUp Unit:=wdLine, Count:=2, Extend:=wdExtend
wdApp.Selection.HomeKey Unit:=wdLine, Extend:=wdExtend

And the following line is saying the number needs to be between -32765
& 32767;
wdApp.Application.PrintOut Filename:="", Range:=wdPrintAllDocument,
Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

Thanks
Tony


On 3 Aug, 11:08, "aidan.herit...@xxxxxxxxxx"
<aidan.herit...@xxxxxxxxxx> wrote:
On 3 Aug, 10:43, bony_tony <tony_in_oz1...@xxxxxxxxxxx> 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)- Hide quoted text -

- Show quoted text -


.



Relevant Pages

  • Not much to report but
    ... working days and informed Dave he'd had a go at me 7 of those. ... On tuesday he reiterated his rant about how the district nurses think ... the one who came round was okay it's only ... nurse got called back they keep saying they will be coming round once ...
    (rec.pets.cats.anecdotes)
  • Re: Not much to report but
    ... working days and informed Dave he'd had a go at me 7 of those. ... On tuesday he reiterated his rant about how the district nurses think ... the one who came round was okay it's only ... nurse got called back they keep saying they will be coming round once ...
    (rec.pets.cats.anecdotes)
  • Re: Doctors choice - Kodak C875 or Canon A630?
    ... or do you not think that saying that I'm ruining this ... you'll also brand this a personal attack. ... ASAAR wrote in the last couple of weeks in rec.photo.digital: ... > You're not dim. ...
    (rec.photo.digital)
  • RE: Auto Number Excel Forms During Save As
    ... I do agree with what you're saying. ... I believe this should be in an database ... Dim ro As Range ... I'm working on a purchase order form that is available to multiple ...
    (microsoft.public.excel.programming)
  • Re: merge cells
    ... And I'm saying that you'll have to change the column to what you need--I used ... code to iterate through, looking for borders, and it should only merge the ... Dim iRow as long ... .HorizontalAlignment = xlCenter ...
    (microsoft.public.excel.programming)

Loading