Word Automation Late Binding (1 Viewer)

gleesonc

New member
Local time
Today, 10:45
Joined
Jul 5, 2017
Messages
5
Hi,
After much research I found some code that allows me to fill a table in a Word document using automation. All working very well until I try to change it to late binding.
There's a line of code that shifts the data from one cell to the next one to the right as it inserts the data in the correct order:
docQuote.Application.Selection.MoveRight Unit:=wdCell


Does anyone know the late binding equivalent for Unit:=wdCell?


Thanks in anticipation
Chris
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 13:45
Joined
May 21, 2018
Messages
8,525
For any constant go to the immediate window
?wdCell
12
 

gleesonc

New member
Local time
Today, 10:45
Joined
Jul 5, 2017
Messages
5
Apologies all. :rolleyes:

Further research found the correct number to use.


docQuote.Application.Selection.MoveRight Unit:=12
Also thanks to all the regular contributors - I've learned so much from you all.


Chris


Ooops,
Thanks MajP: I posted my finding before seeing your prompt reply. Thanks heaps.


You are one of the contributors I was referring to above. thanks.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 03:45
Joined
Jan 20, 2009
Messages
12,851
For any constant go to the immediate window
?wdCell
12

A handy alternative that makes it simple for Late Binding is to include a module with all these constants declared.

BTW I sometimes design with the library loaded so the Intellisense works, declare the variable types from the library but instantiate objects with the Late Binding command.

Then it is just a matter of converting the variable declarations from the library item to Object. This switch can done with a find and replace or using Conditional Compilation.
 

gleesonc

New member
Local time
Today, 10:45
Joined
Jul 5, 2017
Messages
5
Thanks Galaxiom.
I will certainly take up your suggestions in the future-will save a lot of time.
Chris
 

Users who are viewing this thread

Top Bottom