Word Automation Late Binding

gleesonc

New member
Local time
Yesterday, 22:21
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
 
For any constant go to the immediate window
?wdCell
12
 
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.
 
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.
 
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

Back
Top Bottom