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 / January 2006

Tip: Looking for answers? Try searching our database.

Moving out of a table, problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 30 Jan 2006 21:26 GMT
Hi! I am experiencing a peculiar problem with moving selection out of Word
table.

I get a document which has a table in the beginning. When I open the file
manually the cursor is blinking in front of the first character inside the
table. I need to insert a couple of line before the table. What happens
instead is I get those lines INSIDE the table.
I tried to do this:

object objUNIT = Word.WdUnits.wdLine;
object objEXTEND = Word.WdMovementType.wdMove;
object objCOUNT = 1;

mySel.InsertParagraph();
mySel.MoveUp(ref objUNIT, ref objCOUNT, ref objEXTEND);

What am I doing wrong ? How would you do it in C#, VB-6 or VBA?

I also seem unable to insert 2 lines in front of embedded tables, images,
files.
What's the general rule on how to do it ?

Thank you in advance,

--Michael
Helmut Weber - 31 Jan 2006 08:48 GMT
Hi Michael,

Selection.SplitTable

with the insertion point somewhere in the first row.

--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
Mike - 31 Jan 2006 21:31 GMT
For the sake of completion, the following code worked in all situations not
just tables:

Selection.HomeKey wdStory
Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=1, Name:=""
ActiveDocument.Bookmarks("\page").Select
Selection.Cut
Selection.HomeKey wdStory
Selection.range.ListFormat.RemoveNumbers
Selection.TypeText "WHATEVER " & vbCrLf
Selection.Paste

> Hi Michael,
>
[quoted text clipped - 7 lines]
> "red.sys" & chr(64) & "t-online.de"
> Word 2002, Windows 2000

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.