A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to remove automatically some pages?



 
 
Thread Tools Display Modes
  #1  
Old August 12th, 2008, 05:39 PM posted to microsoft.public.word.newusers
Tico[_2_]
external usenet poster
 
Posts: 19
Default How to remove automatically some pages?

Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico
  #2  
Old August 12th, 2008, 06:03 PM posted to microsoft.public.word.newusers
Tico[_2_]
external usenet poster
 
Posts: 19
Default How to remove automatically some pages?

Hi All,

I have a big MS Word 97 file.

To be precise: I'll create this big file using MailMerge
so I can add any special character at the beginning
of each page or so.
Unfortunately I am not able to skip the pages using
methods available in MailMerge. I have to do it after
creating the file.

I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico
  #3  
Old August 12th, 2008, 10:39 PM posted to microsoft.public.word.newusers
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default How to remove automatically some pages?

Use a macro containing the following code where you replace the #*# with the
special character that you intend to use.

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico



  #4  
Old August 13th, 2008, 10:47 PM posted to microsoft.public.word.newusers
Tico[_2_]
external usenet poster
 
Posts: 19
Default How to remove automatically some pages?

Thank you very much for your prompt reply.

Unfortunately I don't know enough about macros to be able to use the macro.
When I tried to use it I got the following lines in red:

Do While .Execute(FindText:="#*#", MatchWildcards:=False, Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete

regardless what I replaced the "#*#" with.
My special character is \. I don't even know what I should writei n the macro: "#\#", "\" or simply \

I haven't found FindText in the "VBA for Dummies" for Office 97 that I have so I think I should save my file
as Word 2007 first and then use the macro.
I have Office 2007 (home edition) but I am not familiar with it yet, at least not to use macros.

I am afraid I'll have to remove the pages manually. :-(

Regards
Tico


Użytkownik "Doug Robbins - Word MVP" napisał w wiadomości ...
Use a macro containing the following code where you replace the #*# with the special character that you intend to use.

Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False, Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message ...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico




  #5  
Old August 14th, 2008, 06:23 AM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default How to remove automatically some pages?

The lines indicated in red have wrapped prematurely use the following which
should not wrap

Sub DeleteMarkedPages()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="\", _
MatchWildcards:=False, _
Wrap:=wdFindContinue, _
Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With

http://www.gmayor.com/installing_macro.htm

The macro will remove any page with the \ character in Word 2007 and should
work in Word 97 also, though I don't have it available to check. Word 2007
will open a Word document from Word 97 without the need to 'convert' it.


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very much for your prompt reply.

Unfortunately I don't know enough about macros to be able to use the
macro. When I tried to use it I got the following lines in red:

Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
regardless what I replaced the "#*#" with.
My special character is \. I don't even know what I should writei n
the macro: "#\#", "\" or simply \
I haven't found FindText in the "VBA for Dummies" for Office 97 that
I have so I think I should save my file as Word 2007 first and then use
the macro.
I have Office 2007 (home edition) but I am not familiar with it yet,
at least not to use macros.
I am afraid I'll have to remove the pages manually. :-(

Regards
Tico


Użytkownik "Doug Robbins - Word MVP" napisał
w wiadomości ...
Use a macro containing the following code where you replace the #*#
with the special character that you intend to use. Selection.HomeKey
wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico



  #6  
Old August 15th, 2008, 09:04 AM posted to microsoft.public.word.newusers
Tico[_2_]
external usenet poster
 
Posts: 19
Default How to remove automatically some pages?

Thank you very, very much.
I created a sample file and it works!
Now I have to put the macro into my big file which is a result of MailMerge
and make a lot of tests.

By the way, I know almost nothing about VBA for Word.
I looked at your page and I found a lot of interesting things there.
However what I need most at the moment is any tutorial how to create
simple macros in Word from the very beginning. Not just examples,
which are important too, but first of all the most basic rules.
I read that one of ways is to record macros using Word and then
to analyse it in VBA Editor. I think that this can be useful later,
when you know a lot, but not at the beginning.
I am looking for any lessons, step by step showing what is neccessary
in a macro and what it means. Then more and more functions to
write working macros.
Having such background I'll be able to learn using other methods.

I tried to find anything like this in the Internet to download or use
on line, but without any success. I found a lot for Excel but I read
that the rules are not the same.

Could you please advice me anything suitable for a person who
is just starting with writing macros for Word?

Thanks again for your help.

Regards
Tico


Użytkownik "Graham Mayor" napisał w wiadomości ...
The lines indicated in red have wrapped prematurely use the following which should not wrap

Sub DeleteMarkedPages()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="\", _
MatchWildcards:=False, _
Wrap:=wdFindContinue, _
Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With

http://www.gmayor.com/installing_macro.htm

The macro will remove any page with the \ character in Word 2007 and should work in Word 97 also, though I don't have it available
to check. Word 2007 will open a Word document from Word 97 without the need to 'convert' it.


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very much for your prompt reply.

Unfortunately I don't know enough about macros to be able to use the
macro. When I tried to use it I got the following lines in red:

Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
regardless what I replaced the "#*#" with.
My special character is \. I don't even know what I should writei n
the macro: "#\#", "\" or simply \
I haven't found FindText in the "VBA for Dummies" for Office 97 that
I have so I think I should save my file as Word 2007 first and then use the macro.
I have Office 2007 (home edition) but I am not familiar with it yet,
at least not to use macros.
I am afraid I'll have to remove the pages manually. :-(

Regards
Tico


Użytkownik "Doug Robbins - Word MVP" napisał
w wiadomości ...
Use a macro containing the following code where you replace the #*#
with the special character that you intend to use. Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico




  #7  
Old August 15th, 2008, 09:58 AM posted to microsoft.public.word.newusers
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default How to remove automatically some pages?

See the article "Getting To Grips With VBA Basics In 15 Minutes" at:

http://www.word.mvps.org/FAQs/Macros...csIn15Mins.htm

And many of the other articles at that website.

However, be advised that the only way to learn is to do.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Thank you very, very much.
I created a sample file and it works!
Now I have to put the macro into my big file which is a result of
MailMerge
and make a lot of tests.

By the way, I know almost nothing about VBA for Word.
I looked at your page and I found a lot of interesting things there.
However what I need most at the moment is any tutorial how to create
simple macros in Word from the very beginning. Not just examples,
which are important too, but first of all the most basic rules.
I read that one of ways is to record macros using Word and then
to analyse it in VBA Editor. I think that this can be useful later,
when you know a lot, but not at the beginning.
I am looking for any lessons, step by step showing what is neccessary
in a macro and what it means. Then more and more functions to
write working macros.
Having such background I'll be able to learn using other methods.

I tried to find anything like this in the Internet to download or use
on line, but without any success. I found a lot for Excel but I read
that the rules are not the same.

Could you please advice me anything suitable for a person who
is just starting with writing macros for Word?

Thanks again for your help.

Regards
Tico


Użytkownik "Graham Mayor" napisał w wiadomości
...
The lines indicated in red have wrapped prematurely use the following
which should not wrap

Sub DeleteMarkedPages()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="\", _
MatchWildcards:=False, _
Wrap:=wdFindContinue, _
Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With

http://www.gmayor.com/installing_macro.htm

The macro will remove any page with the \ character in Word 2007 and
should work in Word 97 also, though I don't have it available
to check. Word 2007 will open a Word document from Word 97 without the
need to 'convert' it.


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very much for your prompt reply.

Unfortunately I don't know enough about macros to be able to use the
macro. When I tried to use it I got the following lines in red:

Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
regardless what I replaced the "#*#" with.
My special character is \. I don't even know what I should writei n
the macro: "#\#", "\" or simply \
I haven't found FindText in the "VBA for Dummies" for Office 97 that
I have so I think I should save my file as Word 2007 first and then use
the macro.
I have Office 2007 (home edition) but I am not familiar with it yet,
at least not to use macros.
I am afraid I'll have to remove the pages manually. :-(

Regards
Tico


Użytkownik "Doug Robbins - Word MVP" napisał
w wiadomości ...
Use a macro containing the following code where you replace the #*#
with the special character that you intend to use. Selection.HomeKey
wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico






  #8  
Old August 15th, 2008, 12:21 PM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default How to remove automatically some pages?

If you are splitting the results of a mail merge, see
http://www.gmayor.com/individual_merge_letters.htm
As Doug says, the only way to learn vba is to put it to use to perform
simple tasks and then get more adventurous. You can always use the macro
recorder to give you some ideas. It is by no means perfect but it does help
get you started.
You will find lots of coding examples in the vba programming forums and on
various web site, including my own.
The vba help in Word 2007 is rather better than in earlier versions.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very, very much.
I created a sample file and it works!
Now I have to put the macro into my big file which is a result of
MailMerge and make a lot of tests.

By the way, I know almost nothing about VBA for Word.
I looked at your page and I found a lot of interesting things there.
However what I need most at the moment is any tutorial how to create
simple macros in Word from the very beginning. Not just examples,
which are important too, but first of all the most basic rules.
I read that one of ways is to record macros using Word and then
to analyse it in VBA Editor. I think that this can be useful later,
when you know a lot, but not at the beginning.
I am looking for any lessons, step by step showing what is neccessary
in a macro and what it means. Then more and more functions to
write working macros.
Having such background I'll be able to learn using other methods.

I tried to find anything like this in the Internet to download or use
on line, but without any success. I found a lot for Excel but I read
that the rules are not the same.

Could you please advice me anything suitable for a person who
is just starting with writing macros for Word?

Thanks again for your help.

Regards
Tico


Użytkownik "Graham Mayor" napisał w
wiadomości ...
The lines indicated in red have wrapped prematurely use the
following which should not wrap Sub DeleteMarkedPages()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="\", _
MatchWildcards:=False, _
Wrap:=wdFindContinue, _
Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With

http://www.gmayor.com/installing_macro.htm

The macro will remove any page with the \ character in Word 2007 and
should work in Word 97 also, though I don't have it available to
check. Word 2007 will open a Word document from Word 97 without the
need to 'convert' it. --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very much for your prompt reply.

Unfortunately I don't know enough about macros to be able to use the
macro. When I tried to use it I got the following lines in red:

Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
regardless what I replaced the "#*#" with.
My special character is \. I don't even know what I should writei n
the macro: "#\#", "\" or simply \
I haven't found FindText in the "VBA for Dummies" for Office 97 that
I have so I think I should save my file as Word 2007 first and then
use the macro. I have Office 2007 (home edition) but I am not
familiar with it yet, at least not to use macros.
I am afraid I'll have to remove the pages manually. :-(

Regards
Tico


Użytkownik "Doug Robbins - Word MVP"
napisał w wiadomości ...
Use a macro containing the following code where you replace the #*#
with the special character that you intend to use.
Selection.HomeKey wdStory Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of
my services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico



  #9  
Old August 16th, 2008, 09:48 AM posted to microsoft.public.word.newusers
Tico[_2_]
external usenet poster
 
Posts: 19
Default How to remove automatically some pages?

Thank you both very, very much once again.

I used the macro to the big MailMerge output file and it works perfectly.
The macro would work faster if it could test just the first character
on each page but I don't know how to change it. But it works very well
and I am very grateful.

As for a tutorial I expected something I had when I learnt other languages
which began with "Hello World" or something like this. Then, step by step,
it showed how to use more and more complicated language tools.

Regards
Tico


Użytkownik "Graham Mayor" napisał w wiadomości ...
If you are splitting the results of a mail merge, see http://www.gmayor.com/individual_merge_letters.htm
As Doug says, the only way to learn vba is to put it to use to perform simple tasks and then get more adventurous. You can always
use the macro recorder to give you some ideas. It is by no means perfect but it does help get you started.
You will find lots of coding examples in the vba programming forums and on various web site, including my own.
The vba help in Word 2007 is rather better than in earlier versions.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very, very much.
I created a sample file and it works!
Now I have to put the macro into my big file which is a result of
MailMerge and make a lot of tests.

By the way, I know almost nothing about VBA for Word.
I looked at your page and I found a lot of interesting things there.
However what I need most at the moment is any tutorial how to create
simple macros in Word from the very beginning. Not just examples,
which are important too, but first of all the most basic rules.
I read that one of ways is to record macros using Word and then
to analyse it in VBA Editor. I think that this can be useful later,
when you know a lot, but not at the beginning.
I am looking for any lessons, step by step showing what is neccessary
in a macro and what it means. Then more and more functions to
write working macros.
Having such background I'll be able to learn using other methods.

I tried to find anything like this in the Internet to download or use
on line, but without any success. I found a lot for Excel but I read
that the rules are not the same.

Could you please advice me anything suitable for a person who
is just starting with writing macros for Word?

Thanks again for your help.

Regards
Tico


Użytkownik "Graham Mayor" napisał w
wiadomości ...
The lines indicated in red have wrapped prematurely use the
following which should not wrap Sub DeleteMarkedPages()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="\", _
MatchWildcards:=False, _
Wrap:=wdFindContinue, _
Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With

http://www.gmayor.com/installing_macro.htm

The macro will remove any page with the \ character in Word 2007 and
should work in Word 97 also, though I don't have it available to
check. Word 2007 will open a Word document from Word 97 without the
need to 'convert' it. --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very much for your prompt reply.

Unfortunately I don't know enough about macros to be able to use the
macro. When I tried to use it I got the following lines in red:

Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
regardless what I replaced the "#*#" with.
My special character is \. I don't even know what I should writei n
the macro: "#\#", "\" or simply \
I haven't found FindText in the "VBA for Dummies" for Office 97 that
I have so I think I should save my file as Word 2007 first and then
use the macro. I have Office 2007 (home edition) but I am not
familiar with it yet, at least not to use macros.
I am afraid I'll have to remove the pages manually. :-(

Regards
Tico


Użytkownik "Doug Robbins - Word MVP"
napisał w wiadomości ...
Use a macro containing the following code where you replace the #*#
with the special character that you intend to use.
Selection.HomeKey wdStory Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of
my services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico




  #10  
Old August 16th, 2008, 10:21 AM posted to microsoft.public.word.newusers
Graham Mayor
external usenet poster
 
Posts: 18,297
Default How to remove automatically some pages?

Page is a vague concept in Word which is not a page layout application and
if you remove pages the document reflows to create a new 'page' structure.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you both very, very much once again.

I used the macro to the big MailMerge output file and it works
perfectly. The macro would work faster if it could test just the first
character
on each page but I don't know how to change it. But it works very well
and I am very grateful.

As for a tutorial I expected something I had when I learnt other
languages which began with "Hello World" or something like this. Then,
step by
step, it showed how to use more and more complicated language tools.

Regards
Tico


Użytkownik "Graham Mayor" napisał w
wiadomości ...
If you are splitting the results of a mail merge, see
http://www.gmayor.com/individual_merge_letters.htm As Doug says, the only
way to learn vba is to put it to use to
perform simple tasks and then get more adventurous. You can always
use the macro recorder to give you some ideas. It is by no means
perfect but it does help get you started. You will find lots of coding
examples in the vba programming forums
and on various web site, including my own. The vba help in Word 2007 is
rather better than in earlier versions.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very, very much.
I created a sample file and it works!
Now I have to put the macro into my big file which is a result of
MailMerge and make a lot of tests.

By the way, I know almost nothing about VBA for Word.
I looked at your page and I found a lot of interesting things there.
However what I need most at the moment is any tutorial how to create
simple macros in Word from the very beginning. Not just examples,
which are important too, but first of all the most basic rules.
I read that one of ways is to record macros using Word and then
to analyse it in VBA Editor. I think that this can be useful later,
when you know a lot, but not at the beginning.
I am looking for any lessons, step by step showing what is
neccessary in a macro and what it means. Then more and more
functions to write working macros.
Having such background I'll be able to learn using other methods.

I tried to find anything like this in the Internet to download or
use on line, but without any success. I found a lot for Excel but I
read that the rules are not the same.

Could you please advice me anything suitable for a person who
is just starting with writing macros for Word?

Thanks again for your help.

Regards
Tico


Użytkownik "Graham Mayor" napisał w
wiadomości ...
The lines indicated in red have wrapped prematurely use the
following which should not wrap Sub DeleteMarkedPages()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="\", _
MatchWildcards:=False, _
Wrap:=wdFindContinue, _
Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
Loop
End With

http://www.gmayor.com/installing_macro.htm

The macro will remove any page with the \ character in Word 2007
and should work in Word 97 also, though I don't have it available
to check. Word 2007 will open a Word document from Word 97 without
the need to 'convert' it. --

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Tico wrote:
Thank you very much for your prompt reply.

Unfortunately I don't know enough about macros to be able to use
the macro. When I tried to use it I got the following lines in
red: Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete
regardless what I replaced the "#*#" with.
My special character is \. I don't even know what I should writei
n the macro: "#\#", "\" or simply \
I haven't found FindText in the "VBA for Dummies" for Office 97
that I have so I think I should save my file as Word 2007 first
and then use the macro. I have Office 2007 (home edition) but I
am not familiar with it yet, at least not to use macros.
I am afraid I'll have to remove the pages manually. :-(

Regards
Tico


Użytkownik "Doug Robbins - Word MVP"
napisał w wiadomości
...
Use a macro containing the following code where you replace the
#*# with the special character that you intend to use.
Selection.HomeKey wdStory Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="#*#", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Bookmarks("\page").Range.Delete Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself
of my services on a paid consulting basis.

Doug Robbins - Word MVP

"Tico" wrote in message
...
Hi All,

I have a big MS Word 97 file.
I am looking for any method that let me remove
automatically some pages which I can mark
using, for example, a special character as the
first on each page or in any other way.
I would be also satisfied if I could automatically
skip the pages whilst printing the file.

I can use the MS Word 2007 to do it, if necessary.

Could anyone help me please?
The matter is urgent.:-)

Regards
Tico



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Š2004-2024 OfficeFrustration.
The comments are property of their posters.