Pagina 1 din 1

Font RoBookman sau inlocuitor

Scris: 15 Martie 2007 03:42
de nobodymentos
salut,
am niste documente word mai vechi scrise cu un font numit RoBookman
la vremea acea asta m-a ajutat sa scriu cu caractere romanesti
i lipsa fontului nu mai vad documentul corect

Av]nd ^n vedere c[ via\a social[ este ^n permanent[ schimbare, se recomand[ ca ^nainte de a declan`a cercetarea propriu-zis[ s[ se procedeze la o anchet[ “pilot” – o anchet[ pe un num[r mic de subiec\i

mai are cine fontul asta printr-o arhiva ? sau stie cineva vreo solutie ?

multumesc anticipat

Scris: 15 Martie 2007 09:32
de dorin
Am avut și eu exact aceeași problemă, cu documente Word scrise acum 10-15 ani cu fonturi gen TimesRomanSF, Times etc. Deși am păstrat fonturile, și puteam citi sau tipări documentele la mine, totuși nu se puteau citi pe altă mașină decît dacă instalam și fonturile. Ca să nu mai fie probleme, prin 2001 am zis că cea mai bună soluție este înlocuirea fontului și caracterelor respective din documente, conform mapării curente Microsoft de la vremea respectivă (din Times New Roman și celelalte fonturi care aveau caractere românești în WinMe). Pentru asta am scris o macrocomandă chiar în Visual Basic‑ul din Word, care făcea înlocuirile respective în documentul curent. Sigur, dacă ai multe documente, poți face un mic progrămel în Borland Delphi (care știe să folosească funcțiile avansate ale Word‑ului), care să facă în background înlocuirile respective, în toate documentele de pe hard‑disk (adică Delphi va deschide Word‑ul, și toate documentele, "invizibil" pentru operator, fără să‑i afișeze interfața, doar vei auzi hard‑disk‑ul că mestecă, și îți va "repara" documentele"). O soluție de genul ăsta va trebui aplicată, la scară mai mare, peste tot unde există date vechi, neconforme cu standardul actual.

Macrocomanda pe care am scris-o în Visual Basic pentru Word arăta cam așa:

Cod: Selectați tot

Sub trsf()
'
' trsf Macro
' Macro recorded 30.11.01 by Dorin Rusu
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(195)
        .Replacement.Text = ChrW(258)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(170)
        .Replacement.Text = ChrW(350)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(222)
        .Replacement.Text = ChrW(354)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(227)
        .Replacement.Text = ChrW(259)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(186)
        .Replacement.Text = ChrW(351)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(254)
        .Replacement.Text = ChrW(355)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Font.Name = "Times-RomanSF"
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Name = "Times New Roman"
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    
        If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
        ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
        ActivePane.View.Type = wdOutlineView Or ActiveWindow.ActivePane.View.Type _
         = wdMasterView Then
        ActiveWindow.ActivePane.View.Type = wdPageView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(195)
        .Replacement.Text = ChrW(258)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(170)
        .Replacement.Text = ChrW(350)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(222)
        .Replacement.Text = ChrW(354)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(227)
        .Replacement.Text = ChrW(259)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(186)
        .Replacement.Text = ChrW(351)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(254)
        .Replacement.Text = ChrW(355)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Font.Name = "Times-RomanSF"
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Name = "Times New Roman"
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
        
        If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
        ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
        ActivePane.View.Type = wdOutlineView Or ActiveWindow.ActivePane.View.Type _
         = wdMasterView Then
        ActiveWindow.ActivePane.View.Type = wdPageView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(195)
        .Replacement.Text = ChrW(258)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(170)
        .Replacement.Text = ChrW(350)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(222)
        .Replacement.Text = ChrW(354)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(227)
        .Replacement.Text = ChrW(259)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(186)
        .Replacement.Text = ChrW(351)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ChrW(254)
        .Replacement.Text = ChrW(355)
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    Selection.Find.ClearFormatting
    Selection.Find.Font.Name = "Times-RomanSF"
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Name = "Times New Roman"
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.HomeKey Unit:=wdStory
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
 
End Sub

Scris: 16 Martie 2007 01:11
de nobodymentos
am folosit macrocomanda cu mici modificari la valorile caracterelor si a functionat :)

super .... multumesc mult pentru solutie

Scris: 16 Martie 2007 15:25
de dorin
Mă bucur că ți‑a fost de folos. Același lucru se poate face manipulînd Word‑ul, de exemplu, cu Borland Delphi, dat fiind că acesta suportă tehnologia OLE Automation, astfel încît poate folosi Word‑ul ca server, apelînd obiectele, metodele și proprietățile acestuia, așa cum sînt ele definite în Visual Basic pentru Word.
De exemplu, următorul progrămel creează o instanță a Word‑ului, deschide documentul "document_cucu.doc" din C:\, caută toate aparițiile cuvîntului "cucu", le înlocuiește cu "bau", salvează și închide documentul. Dacă se omite linia "v.Visible:=true;", aplicația Word va fi deschisă invizibil pentru utilizator - se va auzi doar zgomotul făcut de hard‑disk, iar la sfîrșit se va vedea că în C:\ a apărut fișierul "document_bau.doc":

Cod: Selectați tot

uses ComObj;
procedure TForm1.Button1Click(Sender: TObject);
    var v:variant;
begin
    v:=CreateOleObject("Word.Application");
    [color=blue]v.Visible:=true;[/color]
    v.Documents.Open FileName:="C:\document_cucu.doc";
    v.Selection.Find.ClearFormatting;
    v.Selection.Find.Replacement.ClearFormatting;
    With v.Selection.Find
        .Text = "cucu"
        .Replacement.Text = "bau"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With;
    v.Selection.Find.Execute Replace:=wdReplaceAll;
    v.Selection.HomeKey Unit:=wdStory;
    With v.Documents("document_cucu.doc")
        .SaveAs FileName:= "document_bau.doc"
        .Close
    End With;

end;