|
|
|
|
|
<Word Processing>.Insert (Function) In french: <Traitement de texte>.Insère Inserts an object in a Word Processing control. The objects that can be used are: - an element,
- a document,
- a paragraph,
- a text,
- an image,
- a fragment.
sFichier is string
sFichier = fImageSelect(fCurrentDir(), "", ...
"Insérer une image","JPEG (*.JPG)" + TAB + "*.jpg" + CR + ...
"PNG (*.PNG)" + TAB + "*.png" + CR + "Tous les fichiers (*.*)" + TAB + "*.*")
IF sFichier = "" THEN
RETURN
END
img is Image
img = sFichier
elt is docElement
elt.Type = typeDocElementImage
elt.Image.ImageBuffer = img
elt.Image.Wrapping = docWrappingAlignedOnText
elt.Image.Width = img.Width * 25.4 / 96.0
elt.Image.Height = img.Height * 25.4 / 96.0
elt.Image.X = 0
elt.Image.Y = 0
TT_MonDocument.Insère(TT_MonDocument.Curseur, elt)
doc is Document <- TT_MonDocument.Valeur
fragmentSignet is docFragment = doc.Bookmark["Signet 1"]
IF fragmentSignet <> Null THEN
let nPositionInsertion = fragmentSignet.EndPosition
TT_MonDocument.Insère(nPositionInsertion, "Texte à insérer à la position du signet")
ELSE
Error("Signet 'Signet 1' non trouvé dans le document")
END
Syntax
Inserting an object at a position Hide the details
<Result> = <Word Processing control>.Insert(<Position> , <Element>)
<Result>: docFragment variable docFragment variable with the inserted fragment. <Word Processing control>: Control name Name of the Word Processing control to be manipulated. <Position>: Integer Position where the element will be inserted. This position is expressed in number of characters. <Element>: Type corresponding to the element to insert Element to insert: - Element: Name of the docElement type variable corresponding to the element to be inserted.
- Document: Name of the Document variable corresponding to the document to be inserted.
Caution: The following elements of the inserted document are not retained: - The default layout of the inserted document (e.g. margins).
- The parameters of the main section of the inserted document (e.g. headers and footers).
- Paragraph: Name of the docParagraph variable corresponding to the paragraph to be inserted.
- String text: Text to be inserted.
You can use the following constants in the insertion text to manage the different possible breaks:
| | docColumnBreak | Adds a column break in a multicolumn section. If the section is not multicolumn, a page break is added. | docLineBreak | Adds a line break. | docPageBreak | Adds a page break. | docParagraphBreak | Adds a paragraph break to. |
- Image: Name of the Image variable to be inserted at the specified position.
- Fragment: Name of the docFragment variable to be inserted at the specified position.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|