Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

MoveDown method does not appear to be working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PromisedOyster - 04 Feb 2005 07:07 GMT
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?
Howard Kaikow - 06 Feb 2005 19:10 GMT
Use the Range object instead of the Selection object.

Signature

http://www.standards.com/; See Howard Kaikow's web site.

> Hi
>
[quoted text clipped - 31 lines]
>
> Can anyone offer any assistance?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.