For example I have 100 pages of a Microsoft Word document and I want to extract each page’s contents into one file (page_1.doc for first page, page_2.doc for second page and so on), so how should I do it?
Fortunately I can run a simple macros script to do it. Watch this tutorial:
Here is the script:
' MakeEachPageHTML Macro
' Used to set criteria for moving through the document by page.
Application.Browser.Target = wdBrowsePage
For i = 1 To ActiveDocument.BuiltInDocumentProperties("Number of Pages")
'Select and copy the text to the clipboard
' Open new document to paste the content of the clipboard into.
' Removes the break that is copied at the end of the page, if any.
DocNum = DocNum + 1
ActiveDocument.SaveAs FileName:="page_" & DocNum & ".doc", FileFormat:=wdFormatDocument, AddToRecentFiles:=True
' Move the selection to the next page in the document
Or try this one:
Dim orig As Document
Dim page As Document
Dim numPages As Integer
Dim idx As Integer
Dim fn As String
' Keep a reference to the current document.
Set orig = ActiveDocument
' Calculate the number of pages
numPages = ActiveDocument.BuiltInDocumentProperties("Number of Pages")
For idx = 1 To numPages
' Make sure the document is active
' Go to the page with index idx
Selection.GoTo What:=wdGoToPage, Name:=idx
' Select the current page
Selection.GoTo What:=wdGoToBookmark, Name:="\page"
' Copy the selection
' Create a new document
Set page = Documents.Add
' Activate it
' Paste the selection
' Generate the file name
fn = "C:\converted\page_" + CStr(idx) + ".doc"
' Save the document as Word 97-2003
page.SaveAs FileName:=fn, FileFormat:=wdFormatDocument, AddToRecentFiles:=False
' Close the document
In this tutorial I will show you how to build an Android app game from Unity. Many people face an error when exporting Android .apk file from Unity and me too. In this video I will show you how did I solve it.