[VB.NET & MS Word] Probleem Picture Invoegen (2)

Pagina: 1
Acties:
  • 48 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:
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



ik heb HEEL deze code zelf opgezocht en geschreven, ik wil niet dat men de code debugged, want ze werkt!!!!! lees dan eerst wat men probleem is voordat je m'n topic sluit
ik moet foto's op de 2e pagina krijgen en dit lukt me niet door deze lus

  • ChroMe
  • Registratie: Maart 2004
  • Laatst online: 07-01 15:25
Dit is trouwens een onderdeeltje van een project voor school waar we al van oktober aan bezig zijn... dus zeg aub niet dat ik er eerst zelf moeite voor moet doen...

  • curry684
  • Registratie: Juni 2000
  • Laatst online: 12-05 22:23

curry684

left part of the evil twins

Welk gedeelte van whoami's post was niet helemaal duidelijk? :?
Ik zie toch echt in die quickstart staan:
• Geef eerst globaal aan wat het probleem is
• Geef vervolgens aan waar je denkt dat het aan ligt
• Geef vervolgens aan wat je al geprobeerd hebt.
• Geef aan waarom je denkt dat dat niet klopt of geef aan waarom je denkt dat dat niet werkt.

En post alleen relevante code: 98 regels code zijn nooit relevant en maken je topic onleesbaar. Elimineer het probleem en presenteer ons de voorbewerkte uitsnede.

Professionele website nodig?


Dit topic is gesloten.