Solved

Delete first page of word document

Posted on 2004-04-05
3
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp.net, radiobuttonlist, c# 3 69
Unprotect Visio drawing page in C# 4 21
C# LINQ query question 11 31
How do you think this website does searches? 5 34
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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