SPOLUPR┴CE S OFFICE


P°evod databßze do Wordu:


Jazyk BONANZA: Sub WordButClick(Sender) Set V = CreateObject("Word.Application") V.Visible = True V.WordBasic.Filenew("NORMAL") V.WordBasic.EditSelectAll V.Selection.Font.Name = "Times New Roman" V.Selection.Font.Size = 20 V.WordBasic.Insert("OZOGAN BONANZA") For I = 1 to 3 V.WordBasic.Insert(chr(13) + chr(10)) Next V.Selection.Font.Size = 10 Set MyTable = V.ActiveDocument.Tables.Add(V.Selection.Range, Table1.RecordCount,Table1.FieldCount) Table1.First For I = 0 To Table1.RecordCount-1 For J = 0 To Table1.FieldCount-1 MyTable.Cell(I+1,J+1).Range.InsertAfter(Table1.Fields(J).AsString) Next Table1.Next Next End Sub

Jazyk JUKON: function WordButClick(Sender) { v = new ActiveXObject('Word.Application'); with (v) { Visible = true; WordBasic.filenew('normal'); WordBasic.editselectall; selection.Font.name = 'Times New Roman'; selection.Font.size = 20; WordBasic.Insert("OZOGAN JUKON"); for (i = 0 ; i < 3 ; i++) WordBasic.Insert(chr(13) + chr(10)); selection.Font.size = 10; myTable = ActiveDocument.Tables.Add(Selection.Range, Table1.RecordCount,Table1.FieldCount ) Table1.First; for (i = 0 ; i < Table1.RecordCount-1;i++ ) { for (j = 0 ; j < Table1.FieldCount; j++ ) { myTable.Cell(i+1,j+1).Range.InsertAfter(Table1.Fields(j).AsString); } Table1.Next; } } }

P°evod databßze do Excelu:


Jazyk BONANZA: Sub ExcelButClick(Sender) Set V = CreateObject("Excel.Application.8") V.Visible = True V.WorkBooks.Add V.ActiveSheet.Cells(1,1).Font.Size = 20 V.ActiveSheet.Cells(1,1) = "OZOGAN BONANZA" Table1.First S = "" While not (Table1.Eof) For J = 0 to Table1.FieldCount-1 S = S + Table1.Fields(j).AsString + chr(9) Next S = S+Chr(13)+Chr(10) Table1.Next Wend V.ActiveSheet.Cells(3,1).Select Clipboard.AsText = S V.ActiveSheet.Paste V.ActiveSheet.Cells(3,1).Select End Sub

Jazyk JUKON: function ExcelButClick(Sender) { v = new ActiveXObject('Excel.Application'); v.visible = true; v.WorkBooks.Add; v.ActiveSheet.Cells(1,1).Font.Size = 20; v.ActiveSheet.Cells(1,1) = "OZOGAN JUKON"; Table1.First; s=''; while (!Table1.eof) { for (j = 0 ; j < Table1.FieldCount; j++ ) s = s + Table1.Fields(j).AsString+chr(9); s = s+ chr(13)+chr(10); Table1.Next; } v.ActiveSheet.Cells(3,1).Select; Clipboard.AsText = s; v.ActiveSheet.Paste; v.ActiveSheet.Cells(3,1).Select; }


Odeslßnφ e-mailu z Outlooku:


Jazyk BONANZA: Sub Button1Click(Sender) Set X = CreateObject("Outlook.Application") Set out = X.CreateItem(olMailItem) out.Recipients.Add Edit1.Text 'adresa, kam poslat zprßvu out.Subject = Edit2.Text 'p°edm∞t zprßvy out.Body = Memo1.Text 'text zprßvy out.Attachments.Add "c:\config.sys" 'p°φloha zprßvy out.Send 'odeÜle zprßvu Set out = Nothing Set X = Nothing showmessage("Zprßva byla odeslßna") End Sub

Jazyk JUKON: function Button1Click(Sender) { Button1.Enabled = false; X = new ActiveXObject('Outlook.Application'); // Out = X.CreateItem(olMailItem) ; //konstanta s hodnotou nula Out = X.CreateItem(0); Out.Recipients.Add(Edit1.Text); //adresa, kam poslat zprßvu Out.Subject = Edit2.Text; //p°edm∞t zprßvy Out.Body = Memo1.Text; //text zprßvy Out.Send; //odeÜle zprßvu Button1.Enabled = true; ShowMessage('Zprßva byla odeslßna'); }


Kontrola pravopisu ve Wordu:


Jazyk BONANZA: Sub Button1Click(Sender) Set X = CreateObject("Word.Application") X.Visible = False X.Documents.Add X.Selection.Text = Memo1.Text X.ActiveDocument.CheckSpelling Memo1.Clear Memo1.Text = Replace(X.Selection.Text, Chr(13), Chr(13)+Chr(10)) X.Quit Set X = Nothing ShowMessage("Text byl zkontrolovßn") End Sub

Jazyk JUKON: function Button1Click(Sender) { X = new ActiveXObject('Word.Application'); X.Visible = false; X.Documents.Add(); X.Selection.Text = Memo1.Text; X.ActiveDocument.CheckSpelling(); S = X.Selection.Text+chr(13); X.Quit(); Memo1.Clear; while (S.length>0) { P = S.indexOf(chr(13)); W = S.substring(0, P); Memo1.Lines.Add(W); S = S.substring(P+1, S.length); } ShowMessage('Text byl zkontrolovßn'); }


OZOGAN, 1 Mßje 97, 460 01 Liberec
tel.,fax: (048) 52 28 338, e-mail: info@ozogan.cz