Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
hi everybody!
here is the code which allows the merging of my table: code merging of table oRange = oSelection.GetRange(); oTables = oDoc.GetTables(); oTable = oTables.Add(oRange,nb_lignes,1,vtOptional,vtOption al); oTable.AutoFormat( vtFormatContemporary, vtOptional, vtOptional, vtOptional , vtOptional, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional); Cell oCellTitle = oTable.Cell(1,1); oRange = oCellTitle.GetRange(); oMailMergeFields.Add(oRange, "RUBRIQUES"); // Creation and merging operation in the cells of the table cellsOfTable( oTable, nb_lignes, oWord, oMailMergeFields); / end code merging of table Here is the code of the inserting of my image code image oRange = oSelection.GetRange(); oParagraphs = oRange.GetParagraphs(); oParagraph = oParagraphs.GetLast(); Range oTargetRange = oParagraph.GetRange(); VARIANT vTargetRange; vTargetRange.vt = VT_DISPATCH; vTargetRange.pdispVal = TargetRange.m_lpDispatch; Shapes shapes = oDoc.GetShapes(); shapes.AddPicture("C:\\Documents and Settings\\Administrateur\\Mes documents\\Mes images\\Matrix.jpg", vtFalse, vtTrue , vtOptional, vtOptional, vtOptional, vtOptional, &vTargetRange); /code image here Code merging ... end code merging the inserting of the image is placed after my merging tables whereas she should be between the 2 tables. Why? In advance, thanks. |
#2
![]() |
|||
|
|||
![]()
Hi Neonico,
In case you hadn't noticed, this is a newsgroup for end-user questions. Programming questions belong in an office.developer or word.vba newsgroup. the inserting of the image is placed after my merging tables whereas she should be between the 2 tables. Why? It's not very clear what your code is doing. Using Selection is always a bit chancy, as well as difficult to follow. You should avoid it... My best guess is this: oParagraph = oParagraphs.GetLast(); Range oTargetRange = oParagraph.GetRange(); If you have two tables, what stands between the two tables? Is there anything between the two tables? Generally, if I want to move directly beneath a table, I do something like this (VB code) Dim tbl as Word.Table Dim rng as Word.Range Set tbl = doc.Tables(1) Set rng = tbl.Range 'Go beneath the table rng.Collapse Direction:=wdCollapseEnd Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Boiletplates from Word Perfect | Microsoft Word Help | |||
How do I create & merge specific data base & master documents? | New Users | |||
In typing dates in Word, i.e. "January 12" how do you keep the "1. | Microsoft Word Help | |||
Using Works Suite 2004 with Word 2002, Insert picture from scanne. | Microsoft Word Help | |||
WP Delay Code - Word Equiv | Microsoft Word Help |