H
Hendrik
Hi,
I am using late binding and trying to insert e.g. 9 images into a table
(3x3) in Word.
I am having trouble moving to the next cell; VB throws an error on
'wrdSelection.moveright 'Unit:=wdCell' - 'Bad command'. Are there any
specific constants for wdCell or not?
code extract:
---------------
Dim WrdApp As Object
Dim WrdDoc As Object
Set WrdApp = CreateObject("Word.Application")
Dim wrdSelection As Object
Set wrdSelection = WrdApp.Selection
Dim sPic As Object
....
'1st Pic
Set sPic = WrdDoc.InlineShapes.AddPicture(FileName:="C:\1.jpg",
LinkToFile:=False, SaveWithDocument:=True)
'Move on 1 column
wrdSelection.moveright
wrdSelection.moveright
'wrdSelection.moveright 'Unit:=wdCell, Count:=1, Extend:=wdMove 'wdCell
throws err msg 'Bad Command'
'WrdDoc.tables(1).Cell(2, 1).Range.Select ' just selects the column but does
not affect next image insert
'2nd Pic
Set sPic = WrdDoc.InlineShapes.AddPicture(FileName:="C:\1.jpg",
LinkToFile:=False, SaveWithDocument:=True)
.....
Thanks any help would be greatly appreciated!
Cheers,
Hendrik
I am using late binding and trying to insert e.g. 9 images into a table
(3x3) in Word.
I am having trouble moving to the next cell; VB throws an error on
'wrdSelection.moveright 'Unit:=wdCell' - 'Bad command'. Are there any
specific constants for wdCell or not?
code extract:
---------------
Dim WrdApp As Object
Dim WrdDoc As Object
Set WrdApp = CreateObject("Word.Application")
Dim wrdSelection As Object
Set wrdSelection = WrdApp.Selection
Dim sPic As Object
....
'1st Pic
Set sPic = WrdDoc.InlineShapes.AddPicture(FileName:="C:\1.jpg",
LinkToFile:=False, SaveWithDocument:=True)
'Move on 1 column
wrdSelection.moveright
wrdSelection.moveright
'wrdSelection.moveright 'Unit:=wdCell, Count:=1, Extend:=wdMove 'wdCell
throws err msg 'Bad Command'
'WrdDoc.tables(1).Cell(2, 1).Range.Select ' just selects the column but does
not affect next image insert
'2nd Pic
Set sPic = WrdDoc.InlineShapes.AddPicture(FileName:="C:\1.jpg",
LinkToFile:=False, SaveWithDocument:=True)
.....
Thanks any help would be greatly appreciated!
Cheers,
Hendrik