How to save things you see on the Internet? Word macro solution for saving news

Note: The current article has been written more than 5 years ago!

Paul Townsend Follow - "Toys of Christmas Past",
Paul Townsend Follow – “Toys of Christmas Past”,

Online is beautiful, but perishable. Today, you see it “live”, tomorrow, it may not be there.

Let’s say you want to mass download some links / pages / web sites to have them as a backup copy. How to do it?

(note – make sure you have the right to save things I talk about below, not everything which is available online is suitable for saving, you might break some rules / laws if you save things without looking at terms & conditions)

If you want to download a whole web site, have a look at:

If you want to crawl a web site, have a look at (it crawls a web site and, at the end, it generates a list of all the links on the web site):

How to download videos from a web site (atypical solution, it’s not what you might be expectng)?

Let’s say you quickly want to open lots of links (then copy / save the information):

or to copy the URLs from the browser to somemplace else:

Let’s say you want to open for download 500 links, one after the other, in browser. How do you make them open one by one? Have a look at:

If you want to save an article with the following formatting:
final link,

I suggest you give a chance to the Microsoft Word macro below.

You just need to copy an article from the Internet, the first line should be a title, then the content, and, at the end, the URL to the article.

When you run the macro, it automatically saves it using the title of the article, and it “pretty” formats it.

Function AlphaNumericOnly(strSource As String) As String
Dim i As Integer
Dim strResult As String

For i = 1 To Len(strSource)
Select Case Asc(Mid(strSource, i, 1))
Case 32, 44, 45, 46, 48 To 57, 65 To 90, 97 To 122: ‘include 32 if you want to include space
strResult = strResult & Mid(strSource, i, 1)
End Select
AlphaNumericOnly = strResult
End Function


Sub Format_text()

‘ Format_text Macro

Selection.HomeKey Unit:=wdStory

If Selection.Information(wdWithInTable) Then
Selection.Rows.ConvertToText Separator:=wdSeparateByParagraphs, _
End If

Selection.HomeKey Unit:=wdStory

Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
Selection.Font.Size = 14
Selection.Font.Name = “Verdana”

With Selection.Font.Shading
.Texture = wdTextureSolid
.ForegroundPatternColor = -603914241
.BackgroundPatternColor = -603914241
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With

Selection.HomeKey Unit:=wdStory

Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft

Selection.Shading.Texture = wdTextureNone
Selection.Shading.ForegroundPatternColor = wdColorAutomatic
Selection.Shading.BackgroundPatternColor = wdColorAutomatic

With Selection.Font.Shading
.Texture = wdTextureSolid
.ForegroundPatternColor = -603914241
.BackgroundPatternColor = -603914241
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With


Options.DefaultHighlightColorIndex = wdNoHighlight
Selection.Range.HighlightColorIndex = wdNoHighlight
Selection.Font.Color = wdColorAutomatic
Selection.ParagraphFormat.LineSpacing = LinesToPoints(1.15)
With Selection.ParagraphFormat
.SpaceBefore = 4
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.LineUnitBefore = 1
End With

Selection.HomeKey Unit:=wdStory


Selection.Font.Size = 1

Selection.HomeKey Unit:=wdStory




Dim Ziua2 As String
Ziua2 = Day(Date)

Ziua2 = Format(Ziua2, “Long Date”)

Dim Luna2 As String
Luna2 = Format(“mm”)


Dim Anul2 As String
Anul2 = Year(Date)

‘Selection.TypeText Text:=Anul2 + “.” + Luna2 + “.” + Ziua2 + ” ”

‘Selection.TypeText Text:=Format(“mm.dd.yyyy”)

Selection.InsertDateTime DateTimeFormat:=”yyyy.MM.dd “, InsertAsField:= _
False, DateLanguage:=wdEnglishUK, CalendarType:=wdCalendarWestern, _

Dim Data2 As String

Selection.HomeKey Unit:=wdStory

With Selection
‘To top of document
.HomeKey Unit:=wdStory

End With

Selection.HomeKey Unit:=wdStory

Selection.EndKey Unit:=wdLine, Extend:=wdExtend

Selection.Range.Case = wdTitleWord

With Selection.Find
.Text = “[!a-zA-Z0-9. ,]”
.Replacement.Text = “”
.Forward = False
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

Dim selBkUp As Range
Set selBkUp = ActiveDocument.Range(Selection.Range.Start, Selection.Range.End)

Dim MyFileName As String

MyFileName = AlphaNumericOnly(Left(CStr(selBkUp), 150) & “.docx”)

‘ Selection.Copy
‘ You can un-comment this line, if you wish to copy the filename to the clipboard


Selection.Font.Size = 26

Selection.HomeKey Unit:=wdStory

Dim CurrentDirectoryPlusFile As String
CurrentDirectoryPlusFile = “C:\Users\olivian\Desktop\” & MyFileName

ActiveDocument.SaveAs2 FileName:=CurrentDirectoryPlusFile, FileFormat:= _
wdFormatXMLDocument, LockComments:=False, Password:=””, AddToRecentFiles _
:=True, WritePassword:=””, ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False, CompatibilityMode:=15

‘ You can delete this line if you find that you need to make changes to the document more often than not and review how the document looks like

End Sub

Partajează pe WhatsApp

2 comentarii la „How to save things you see on the Internet? Word macro solution for saving news”

  1. I’ve found Wayback Machine – very useful whenever a great article / website / even clip disappeared online or I wanted to re-view the old version of a website.

Lasă un comentariu

Puteți folosi Gravatar pentru a adăuga avatar (imagine comentarii).

Acest site folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.