Evilripper Blog

A programmer's work is never done

  • Home
  • Downloads
  • News
  • Wallpapers
  • About Me

14

Nov

Stranezze di Delphi

Posted by evilripper  Published in delphi, development

A volte mi chiedo perche’ non programmavo piu’ in delphi…

Appena ho ripreso ad usarlo mi sono ricordato perche’!!!Le nuove versioni son talmente buggate che ad usarle fanno venire la pelle d’oca!! La versione migliore di delphi e’ stata la 7.0 , tutto il resto e’ stato fatto in maniera approssimativa riadattando codice stravecchio.

Fatevi questa immagine! :-D

no comment

13

Nov

Ole Office Automation Word Replace di una stringa [Delphi]

Posted by evilripper  Published in delphi, development

Visto che gli oggetti ole per poter manipolare materiale microsoft (che schifo) non sono molto intuitivi posto qui il codice una funzione che effettua un replace di una stringa in un documento word… per fare sta cavolata sara’ che non trovavo nulla con google, ma ci ho perso del tempo :-(

  1.  
  2. procedure TForm1.Button3Click(Sender: TObject);
  3.  
  4. var
  5.  
  6.   WordApp: Variant;
  7.  
  8. begin
  9.  
  10.   WordApp:=CreateOLEObject(‘Word.Application’);
  11.  
  12.   WordApp.Documents.Open(‘c:test.doc’);
  13.  
  14.   WordApp.Selection.Find.ClearFormatting;
  15.  
  16.   WordApp.Selection.Find.Text := ‘croce’;
  17.  
  18.   WordApp.Selection.Find.Replacement.Text := ‘testa’;
  19.  
  20.   WordApp.Selection.Find.Forward := True;
  21.  
  22.   WordApp.Selection.Find.MatchAllWordForms := False;
  23.  
  24.   WordApp.Selection.Find.MatchCase := False;
  25.  
  26.   WordApp.Selection.Find.MatchWildcards := False;
  27.  
  28.   WordApp.Selection.Find.MatchSoundsLike := False;
  29.  
  30.   WordApp.Selection.Find.MatchWholeWord := False;
  31.  
  32.   WordApp.Selection.Find.MatchFuzzy := False;
  33.  
  34.   WordApp.Selection.Find.Wrap := wdFindContinue;
  35.  
  36.   WordApp.Selection.Find.Format := False;
  37.  
  38.   WordApp.Selection.Find.Execute(Replace := wdReplaceAll);
  39.  
  40.   //WordApp.Selection.Find.Execute(wdReplaceAll);
  41.  
  42.   WordApp.Visible:=True;
  43.  
  44.   //WordApp.Documents.Save(’c:nuovo.doc’);
  45.  
  46.   WordApp.ActiveDocument.SaveAs(‘c:nuovo.doc’);
  47.  
  48. end;

L’ambiente di sviluppo non mi e’ stato d’aiuto in quanto il ctrl+spazio non elenca ne metodi ne funzioni!!!!
Questa funzione apre un file esistente in c:\ che si chiama test.doc e sostituisce la stringa ‘croce’ con ‘testa’ tutte le volte che la incontra in tutto il documento.Poi lo visualizza e lo salva in un file che crea lui che si chiama nuovo.doc sempre in c:

Fonti:

http://www.delphi3000.com/articles/article_3728.asp?SK=

4 comments

Multilanguages

  • English
  • Italiano

My Flikr

Flickr in the skyInto the whiteiced treesthe thin white lineiced treeSit a momentA lampiced treecollectionHot day :-D

Social Connection







Affiliates & Sponsor

Add to Technorati Favorites

Il Bloggatore


BlogItalia.it - La directory italiana dei blog

Tophost Hosting

7,532 spam comments
blocked by
Akismet

Locations of visitors to this page

Blogroll

  • Rocco Blog
  • jumping head shot
  • The Developers
  • gyf.it
  • lu01 rock band
  • Michele Focchi

Categories

  • database (1)
  • development (13)
    • CSharp (4)
    • delphi (2)
    • javascript (1)
    • php (5)
    • vb.net (1)
  • hacking (2)
  • hardware (12)
    • mobile (1)
  • internet (40)
    • cms (1)
    • google (9)
    • wordpress (1)
  • linux (5)
    • gentoo (4)
  • microsoft (2)
  • Senza categoria (3)
  • software (8)
  • videogames (6)
    • unreal tournament 3 (1)
  • winXp (2)

Archives

  • March 2010 (2)
  • February 2010 (6)
  • January 2010 (6)
  • December 2009 (4)
  • November 2009 (1)
  • October 2009 (5)
  • September 2009 (3)
  • July 2009 (2)
  • May 2009 (1)
  • April 2009 (1)
  • March 2009 (2)
  • February 2009 (1)
  • January 2009 (2)
  • December 2008 (3)
  • November 2008 (4)
  • September 2008 (3)
  • June 2008 (3)
  • May 2008 (1)
  • April 2008 (1)
  • March 2008 (1)
  • February 2008 (4)
  • January 2008 (4)
  • December 2007 (2)
  • November 2007 (4)
  • October 2007 (7)
  • September 2007 (7)
  • August 2007 (2)
  • July 2007 (1)
  • June 2007 (2)

Recent Entries

  • Hackers are not crackers
  • FileZilla Password Recovery
  • Google guilty for violation of privacy
  • Google Chrome bug Error 0xc0000005
  • Windows7 Targets Cracked Activations
  • The Pirate Bay Ip Filtered In Italy!
  • Share With Google Buzz
  • Best Free Online Games
  • Spreaker a new radio 2.0
  • Mobile as Router Wi-fi

Recent Comments

  • Andrea Carnera in AmigaOne X1000 Amiga came back?<…
  • GREY_FOX in Hackers are not crackersGoogle guilty for violation of privacyaddalo.it in Google guilty for violation of privacy
  • diggita.it in Google guilty for violation of privacy
  • GREY_FOX in Google guilty for violation of privacy
  • Elena in Spreaker a new radio 2.0AmigaOne X1000 Amiga came back?<…">luca in AmigaOne X1000 Amiga came back?<…
  • Daniele in AmigaOne X1000 Amiga came back?<…
  • Daniele in Share With Google Buzz…
  • addalo.it in The Pirate Bay Ip Filtered In Italy!