Solved

Delete first page of word document

Posted on 2004-04-05
3
322 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
ID: 10765589
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

912 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

21 Experts available now in Live!

Get 1:1 Help Now