Font RoBookman sau inlocuitor

... cu excepția reclamelor !!
nobodymentos
membru
membru
Mesaje: 2
Membru din: 15 Martie 2007 03:38

Font RoBookman sau inlocuitor

Mesaj de nobodymentos » 15 Martie 2007 03:42

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

dorin
membru
membru
Mesaje: 50
Membru din: 25 Ianuarie 2007 09:12
Localitate: București

Mesaj de dorin » 15 Martie 2007 09:32

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:


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

nobodymentos
membru
membru
Mesaje: 2
Membru din: 15 Martie 2007 03:38

Mesaj de nobodymentos » 16 Martie 2007 01:11

am folosit macrocomanda cu mici modificari la valorile caracterelor si a functionat :)

super .... multumesc mult pentru solutie

dorin
membru
membru
Mesaje: 50
Membru din: 25 Ianuarie 2007 09:12
Localitate: București

Mesaj de dorin » 16 Martie 2007 15:25

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":

uses ComObj;
procedure TForm1.Button1Click(Sender: TObject);
var v:variant;
begin
v:=CreateOleObject("Word.Application");
v.Visible:=true;
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;

Răspunde