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
| <?
include "dbconnect.php";
?>
<script language="vbscript">
Set objWord = CreateObject("Word.Application")
TotalValue = 0
objWord.Visible = True
objWord.Activate
objWord.Documents.Add
with objWord.Selection
.Font.Name = "Arial"
.Font.Size = 10
.ParagraphFormat.TabStops.Add 175
.ParagraphFormat.TabStops.Add 300
.Font.Bold = True
.TypeText "Ontwerp website"+chr(9)+chr(9)+"Bedrag ex. BTW"+chr(13)
.Font.Bold = False
.TypeText chr(13)
<?
$result = mysql_query ("SELECT * FROM factuurSpecificatie WHERE factuurID = 1 ORDER BY (prijs<0)");
$korting = 0;
while ($row = mysql_fetch_row($result)) {
if ($row[2]<0) {
$korting = $korting + 1;
}
if ($korting == 0) {
print ".TypeText \"{$row[1]}\"+chr(9)+chr(9)+\"€ \"+FormatNumber({$row[2]})+chr(13)\n";
print "TotalValue = TotalValue + {$row[2]}\n";
} else {
print ".TypeText ".(($korting==1) ? "chr(13)+\"Korting:\"+" : "")."chr(9)+\"{$row[1]}\"+chr(9)+\"€ \"+FormatNumber({$row[2]})+chr(13)\n";
print "TotalValue = TotalValue + {$row[2]}\n";
}
}
?>
.TypeText chr(13)+chr(13)+chr(13)+chr(13)
.TypeText chr(9)+"Subtotaal ex. BTW"+chr(9)+"€ "+FormatNumber(TotalValue)+chr(13)
.TypeText chr(9)+"BTW 19%"+chr(9)+"€ "+FormatNumber(TotalValue*0.19)+chr(13)
.TypeText chr(13)
.Font.Bold = True
.TypeText chr(9)+"Totaal te betalen"+chr(9)+"€ "+FormatNumber(TotalValue*1.19)+chr(13)
.Font.Bold = False
.ParagraphFormat.TabStops.ClearAll
.typeText chr(13)+chr(13)+chr(13)+chr(13)
.Font.Size = 8
.TypeText "Gelieve te betalen binnen 21 dagen na factuurdatum."+chr(13)
.TypeText "Graag referentienummer en factuurnummer vermelden bij betaling."+chr(13)
end with
</script> |
met het beovenstaande script werden bepaalde gegevens uit een DB in een word document gezet. Alles werkte leuk en aardig totdat ik office XP installeerde ... het script deed helemaal niks meer. Heeft iemand een idee?!