MoveDown method does not appear to be working

P

PromisedOyster

Hi

I am experiencing an issue using the MoveDown method with
WordAutomation when Word is invisible. It works when Word is visible. I
am using Word 2000.

What I want to do is select the table and then move down to the line
following the table.

If Word is invisible, moveDown does not work (no error is produced) and
it returns the value 0.

The code generated by a Word macro is as follows:

Selection.Tables(1).Select
Selection.MoveDown Unit:=wdLine, Count:=1



Below is a code snippet in C# that exhibits the problem:

private Word._Application _wordApp;

_wordApp.Visible = true;

foreach (Word.Table table in wordDoc.Tables)
{
table.Select();
object unit = Word.WdUnits.wdLine;
object unitCount = (object)1;
int i = _wordApp.Selection.MoveDown(ref unit, ref unitCount, ref
oMissing);

// i = 0 when the mode is invisible; it is 1 when the mode is visible
}

Can anyone offer any assistance?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top