How to convert a webpage (from an intranet wiki) to an Office document?

calendar_today Asked Jun 4, 2012
thumb_up 5 upvotes
history Updated April 14, 2026

Direct Answer

A very simple solution is to open the URL of the Wiki in Word's Open Document dialog, e.g. by pasting the URL…. This is a 10-line Word VBA snippet, ranked #31st of 32 by community upvote score, from 2012.


The Problem (Q-score 5, ranked #31st of 32 in the Word VBA archive)

The scenario as originally posted in 2012

I have a set of Wiki pages (MediaWiki style) on my company’s intranet that I would like to convert to Microsoft Office Word documents (or something that I can import in it). I am looking for something that has:

Requirements

  • Keep the formatting as much as it can
  • Does not require to change anything on the server that hosts the Wiki (no plugin can be added nor configuration files can be modified from my side)
  • The solution can be programmatically (as I am a developer too), in flavor of Python/C#/C++ and the like

Exclusions

  • Does not look like a solution as “Wiki to Acrobat PDF Pro to Microsof Office Word” (as we do not have Acrobat PDF Pro). Actually, even the non-Pro version (that allows a “Save as Microsoft Word online” option) is not available in my company (very old version of Adobe suite). However, I can still export the page as a pdf, but from the Wiki we have, it does not look good (because some element are too big, for an A4 format, and the extra parts are scraped out of the produced pdf. I would like them to be included anyway and be able to play with “bad” formatting within Word eventually
  • As it is an intranet wiki, online solutions are out of the scope
  • Solutions that implies I could copy the db of the Wiki and do the operation elsewhere (at home for example) are also out of the scope

Options

  • The solution can be either on Windows or Linux-like (CentOS)
  • If it can do it in batch, it is better, but not required

Question

Would you have any hint of a solution that could fit my needs?

Why community consensus is tight on this one

Across 32 Word VBA entries in the archive, the accepted answer here holds niche answer (below median) status — meaning voters are unusually aligned on the right fix.


The Verified Solution — niche answer (below median) (+5)

10-line Word VBA pattern (copy-ready)

A very simple solution is to open the URL of the Wiki in Word’s Open Document dialog, e.g. by pasting the URL http://en.wikipedia.org/w/index.php?title=Microsoft_Word&printable=yes into the File Name text box. This does not require any programming, still gives a satisfying result.

If you need a batch solution, you can write a simple script in VBA that creates and saves the documents for you:

Sub OpenFromWiki()

    Documents.Open FileName:= _
        "http://en.wikipedia.org/w/index.php?title=Microsoft_Word&printable=yes", _
         ConfirmConversions:=False, ReadOnly:=True, AddToRecentFiles:=False, _
        PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
        WritePasswordDocument:=""

End Sub


When to Use It — vintage (14+ years old, pre-2013)

Ranked #31st in its category — specialized fit

This pattern sits in the 74% tail relative to the top answer. Reach for it when your scenario closely matches the question title; otherwise browse the Word VBA archive for a higher-consensus alternative.

What changed between 2012 and 2026

The answer is 14 years old. The Word VBA object model has been stable across Office 2013, 2016, 2019, 2021, 365, and 2024/2026 LTSC, so the pattern still compiles. Changes that might affect you: 64-bit API declarations (use PtrSafe), blocked macros in downloaded files (Mark-of-the-Web), and the shift toward Office Scripts for web-first workflows.

help
Frequently Asked Questions

This is a below-median answer — when does it still fit?
expand_more

Answer score +5 vs the Word VBA archive median ~4; this entry is niche. The score plus 5 supporting upvotes on the question itself (+5) means the asker and 4 subsequent voters all validated the approach.

Does the 10-line snippet run as-is in Office 2026?
expand_more

Yes. The 10-line pattern compiles on Office 365, Office 2024, and Office LTSC 2026. Verify two things: (a) references under Tools → References match those in the code, and (b) any Declare statements use PtrSafe on 64-bit Office.

This answer is 14 years old. Is it still relevant in 2026?
expand_more

Published 2012, which is 14 year(s) before today’s Office 2026 build. The Word VBA object model has had no breaking changes in that window. Three things to re-test: (1) blocked macros on downloaded files (Mark-of-the-Web), (2) 64-bit API declarations (PtrSafe, LongPtr), (3) any shift toward Office Scripts for web scenarios.

Which Word VBA pattern ranks just above this one at #30?
expand_more

The pattern one rank above is “OpenXml: Copy OpenXmlElement between documents”. If your use case overlaps, compare both before committing.

Data source: Community-verified Q&A snapshot. Q-score 5, Answer-score 5, original post 2012, ranked #31st of 32 in the Word VBA archive. Last regenerated April 14, 2026.