Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: Profil iulia2006
| Femeie 24 ani Bucuresti cauta Barbat 25 - 49 ani |
|
Mrrrr
AdMiN
Inregistrat: acum 18 ani
Postari: 2241
|
|
Sub OpenDocuments() Set xl = CreateObject("Word.Application") Set fs = Application.FileSearch With fs FileName = xl.GetOpenFilename("Word Files (*.doc), *.doc") For i = Len(FileName) To 1 Step -1 If Mid(FileName, i, 1) = "\" Then Exit For End If Next .LookIn = Left(FileName, i - 1) .FileName = "*.doc" If .Execute(SortBy:=msoSortByFileName, _ SortOrder:=msoSortOrderAscending) > 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." i = 1 For i = 1 To .FoundFiles.Count Documents.Open FileName:=.FoundFiles(i) ChangeMargins ActiveDocument.Save ActiveDocument.Close Next i Else MsgBox "There were no files found." End If End With End Sub
Sub ChangeMargins() With ActiveDocument.Styles(wdStyleNormal).Font If .NameFarEast = .NameAscii Then .NameAscii = "" End If .NameFarEast = "" End With With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1) .BottomMargin = CentimetersToPoints(1.5) .LeftMargin = CentimetersToPoints(2) .RightMargin = CentimetersToPoints(1) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1.25) .FooterDistance = CentimetersToPoints(1.25) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False .TwoPagesOnOne = False .BookFoldPrinting = False .BookFoldRevPrinting = False .BookFoldPrintingSheets = 1 .GutterPos = wdGutterPosLeft End With End Sub
_______________________________________
|
|
pus acum 11 ani |
|