Solved

Delete first page of word document

Posted on 2004-04-05
3
321 Views
Last Modified: 2012-05-04
I have files that have information about the file as the fiirst page of the document.  We read this area populate a database with the information.  After the database has been updated I want to delete this first page.  I need some code that will delete the first page of a ms word document.
0
Comment
Question by:gdismukes
3 Comments
 
LVL 4

Accepted Solution

by:
chinhdo1 earned 250 total points
Comment Utility
I guess you already have code to open the Word doc, read data from it, etc. To delete the first page, perhaps you can use the Macro below. Basicall, it nagivates to page 2, then select from there to the top of the document, then delete the selection. This code was generated using Word 2002. If you don't have Word 2002, you can always use the Macro Record function.

Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:="2"
Selection.Find.ClearFormatting

Selection.HomeKey Unit:=wdStory, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now