Bonjour à tous , je n'arrive pas trouver comment coller une image dans word au format voici le code
Dans word il faut faire collage spécial coller "Image en mode point " (format bitmap)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 Dim prenom As String = "toto" Dim nom As String = "tata" Dim signet As String = "essai2" Dim wap As Word.Application wap = CType(CreateObject("word.application"), Word.Application) 'false pour rendre le document invisible wap.Application.Visible = True wap.Application.Documents.Open(FileName:="C:\aide.doc", ReadOnly:=False) Dim mydoc As Word.Document mydoc = wap.ActiveDocument AxInkPicture1.Ink.ClipboardCopy() If mydoc.Bookmarks.Exists(signet) Then mydoc.Bookmarks(signet).Select() End If With wap.Selection ' .PasteSpecial() ' .PasteAndFormat = "Bitmap" '.PasteAndFormat(wapPasteDefault) ' .PasteSpecial(DataType:="Bitmap") '.PasteSpecial(DataFormats.Bitmap) '.PasteSpecial(Link:=False, DisplayAsIcon:=False) .PasteSpecial(Link:=False, DisplayAsIcon:=True) End With Dim FileName As String FileName = (prenom & "_" & nom & "_" & "TFI" & ".doc") mydoc.SaveAs("C:\TEMP vb\" & FileName & ".doc") mydoc.Close() wap.Quit() mydoc = Nothing wap = Nothing End Sub
mais impossible de trouver la bonne commande , et mon meilleur ami google ne trouve pas non plus, auriez-vous une idée
Merci de votre aide
Greg
Partager