B
brad b
Hi, Here's what I have and what I need to do with it
I have several thousand pages of stuff in one document,
and each page begins with raw text , for example:
Date : 6/19/04 Time: 8:30
File : adsigyag3
What I need to do is separate each page into its own
document, instead of all the documents being congested
into one huge document.
So I am trying to create a macro that copies the text of
one page and saves it in a new document named whatever it
specifies (in this case adsigyag3) and then moves to the
next page to do the same. But the problem is, because I
use copy/paste to get the filename (copy the text
adsigyag3, and paste it into the "save as" field), it
works only for that page, and not the other thousand
pages. I noticed the visual basic editor explicitly
states the filename as ActiveDocument.SaveAs
FileName:="adsigyag3.doc". I don't want this, I want it
to save it to whatever is on the clipboard. I found out
the clipboard's contents are stored in wdPasteDefault,
but I don't know how to implement this. Could anyone help
me on this?
And furthermore, multiple consecutive pages have the same
filename specified, and I would like to put all of those
pages in the same document. Since my macro copies one
page and tries to save it, the next page would be
overwritten by the 2nd page with the same filename. Is
there a way I can make the macro do something like this:
copy filename (well not literally its filename).
store filename in a variable?
compare the variable to the pages after it (for matching
text).
if it finds another occurrence it can copy that page too.
if not, it just saves the one page.
Any help would be greatly appreciated.
I have several thousand pages of stuff in one document,
and each page begins with raw text , for example:
Date : 6/19/04 Time: 8:30
File : adsigyag3
What I need to do is separate each page into its own
document, instead of all the documents being congested
into one huge document.
So I am trying to create a macro that copies the text of
one page and saves it in a new document named whatever it
specifies (in this case adsigyag3) and then moves to the
next page to do the same. But the problem is, because I
use copy/paste to get the filename (copy the text
adsigyag3, and paste it into the "save as" field), it
works only for that page, and not the other thousand
pages. I noticed the visual basic editor explicitly
states the filename as ActiveDocument.SaveAs
FileName:="adsigyag3.doc". I don't want this, I want it
to save it to whatever is on the clipboard. I found out
the clipboard's contents are stored in wdPasteDefault,
but I don't know how to implement this. Could anyone help
me on this?
And furthermore, multiple consecutive pages have the same
filename specified, and I would like to put all of those
pages in the same document. Since my macro copies one
page and tries to save it, the next page would be
overwritten by the 2nd page with the same filename. Is
there a way I can make the macro do something like this:
copy filename (well not literally its filename).
store filename in a variable?
compare the variable to the pages after it (for matching
text).
if it finds another occurrence it can copy that page too.
if not, it just saves the one page.
Any help would be greatly appreciated.