[VB.NET & MS Word] Probleem Picture Invoegen

Pagina: 1
Acties:
  • 52 views sinds 30-01-2008

  • ChroMe
  • Registratie: Maart 2004
  • Laatst online: 07-01 15:25
Yoo het probleem is ik heb meerdere pagina's en hij voegt de pictures enkel op de 1e pagina in.
Het gaat om attesten voor deelnemers van een happening, elke pagina is dus een attest, de tekst klopt maar de figuren worden allemaal op pagina 1 boven elkaar geladen

CODE:

code:
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    Dim oWord As Word.Application
    Dim oDoc As Word.Document
    Dim oPara1, oPara2, oPara3, oPara4 As Word.Paragraph
    Dim oPic1, oPic2, oPic3, oPic4 As Word.InlineShape
    Dim oRange As Word.Range

    'Start Word en opent een leeg document
    oWord = CreateObject("Word.Application")
    oWord.Visible = True
    oDoc = oWord.Documents.Add
    oDoc.PageSetup.PageHeight = 595.35 'Het blad liggend leggen
    oDoc.PageSetup.PageWidth = 841.995


    'Nieuwe paragraaf in begin van document
    'TITEL
    For i As Integer = 0 To 5
      oPara1 = oDoc.Content.Paragraphs.Add

      oPara1.Range.Font.Size = 32
      oPara1.Range.Font.Name = "Monotype Corsiva"
      oPara1.Range.Text = "Jefke Vermeulen"
      oPara1.Range.Font.Bold = True
      oPara1.Format.Alignment = WdParagraphAlignment.wdAlignParagraphCenter
      oDoc.Content.Paragraphs.Add() 'Enter in WORD
      oPara1.Range.Font.Size = 16
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()

      oPara1.Range.Font.Size = 16
      oPara1.Range.Font.Name = "Tahoma"
      oPara1.Range.Text = "nam deel aan..."
      oPara1.Range.Font.Bold = True
      oPara1.Format.Alignment = WdParagraphAlignment.wdAlignParagraphCenter
      oDoc.Content.Paragraphs.Add() 'Enter in WORD
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()

      oPara1.Range.Font.Size = 40
      oPara1.Range.Font.Name = "Tahoma"
      oPara1.Range.Text = txtTitel.Text
      oPara1.Range.Font.Bold = True
      oPara1.Format.Alignment = WdParagraphAlignment.wdAlignParagraphCenter
      oDoc.Content.Paragraphs.Add() 'Enter in WORD
      oPara1.Range.Font.Size = 16
      oDoc.Content.Paragraphs.Add()

      oPara1.Range.Font.Size = 16
      oPara1.Range.Font.Name = "Tahoma"
      oPara1.Range.Text = txtDatum.Text
      oPara1.Range.Font.Bold = True
      oPara1.Format.Alignment = WdParagraphAlignment.wdAlignParagraphCenter
      oDoc.Content.Paragraphs.Add() 'Enter in WORD
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oPara1.Range.Font.Size = 16
      oPara1.Range.Font.Name = "Tahoma"
      oPara1.Range.Text = txtInfo.Text
      oPara1.Range.Font.Bold = True
      oPara1.Format.Alignment = WdParagraphAlignment.wdAlignParagraphCenter
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oDoc.Content.Paragraphs.Add()
      oPara1.Range.Font.Size = 16

      'Logo1
      If (path1 <> "") Then
        'oDoc.Content.InlineShapes.AddPicture(path1)
        'oPic1 = oDoc.Content.InlineShapes.AddPicture(path1)
        oDoc.Shapes.AddPicture(FileName:=path1, Left:=0, Top:=0, Width:=120, Height:=120)

      End If

      'Logo2
      If (path2 <> "") Then
        oDoc.Shapes.AddPicture(FileName:=path2, Left:=572, Top:=0, Width:=120, Height:=120)
      End If

      'Handtekening1
      If (path3 <> "") Then
        oDoc.Shapes.AddPicture(FileName:=path3, Left:=0, Top:=330, Width:=120, Height:=120)
      End If
      'Handtekening2
      If (path4 <> "") Then
        oDoc.Shapes.AddPicture(FileName:=path4, Left:=286, Top:=330, Width:=120, Height:=120)
      End If
      'Handtekening3
      If (path5 <> "") Then
        oDoc.Shapes.AddPicture(FileName:=path5, Left:=572, Top:=330, Width:=120, Height:=120)
      End If
    Next

  • whoami
  • Registratie: December 2000
  • Laatst online: 14:08
Hoi, welkom op GoT en op P&W.

Het is niet de bedoeling dat men hier in P&W jouw code gaat gaan debuggen, want dat kan je nl. zelf.
We willen je hier best helpen, maar dan moet je zelf ook al enige moeite gedaan hebben (debuggen, zoeken, proberen, ....) om het probleem op te lossen en vermeld er duidelijk bij wat je al geprobeerd hebt, wat er niet lukt, welke precieze foutmeldingen je evt. krijgt, welke resultaten je krijgt, etc...

Lees even de quickstart, en open dan adhv die quickstart een nieuw topic.

[ Voor 63% gewijzigd door whoami op 24-03-2004 15:12 ]

https://fgheysels.github.io/


Dit topic is gesloten.