Results 1 to 2 of 2

Thread: Word Forums?

  1. #1
    Join Date
    Oct 2003

    Unanswered: Word Forums?

    Can any one help me or give me a office board?

    I need to save each page of a word merge document based on the address of that page, I need to save it as a pdf.

    here is what i thought should workub BreakOnSection()
    ' Used to set criteria for moving through the document by section.
    Application.Browser.Target = wdBrowseSection

    'A mail merge document ends with a section break next page.
    'Subtracting one from the section count stop error message.
    For I = 1 To ((ActiveDocument.Sections.Count) - 1)

    'Note: If a document does not end with a section break,
    'substitute the following line of code for the one above:
    'For I = 1 To ActiveDocument.Sections.Count

    'Select and copy the section text to the clipboard.

    'Create a new document to paste text from clipboard.

    ' Removes the break that is copied at the end of the section, if any.
    Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
    Selection.Delete Unit:=wdCharacter, Count:=1
    ChangeFileOpenDirectory "C:\"
    DocNum = DocNum + 1
    ActiveDocument.SaveAs FileName:="test_" & DocNum & ".doc"
    ' Move the selection to the next section in the document.
    Next I
    ActiveDocument.Close savechanges:=wdDoNotSaveChanges
    End Sub

  2. #2
    Join Date
    Oct 2003
    I'm not much on Word, but Woody has written many books and operates an excellent site for office. Woody's Lounge

    Anne Troy is a Word expert: Office Articles
    old, slow, and confused
    but at least I'm inconsistent!

    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts