Reply
 
Thread Tools Display Modes
  #1   Report Post  
neonico
 
Posts: n/a
Default how does one insert a picture in word?

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   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boiletplates from Word Perfect linda Microsoft Word Help 1 January 28th 05 05:37 PM
How do I create & merge specific data base & master documents? maggiev New Users 2 January 12th 05 11:30 PM
In typing dates in Word, i.e. "January 12" how do you keep the "1. Carol Microsoft Word Help 2 January 12th 05 08:09 PM
Using Works Suite 2004 with Word 2002, Insert picture from scanne. jmb Microsoft Word Help 2 January 12th 05 12:41 AM
WP Delay Code - Word Equiv Mike G - Milw, WI Microsoft Word Help 6 January 10th 05 04:12 PM


All times are GMT +1. The time now is 10:59 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"