Quote:
Originally Posted by kramer74
How do I know where the new documents are going to be saved, as they've ended up in three different folders as I've been using the macro.
...
I have changed the following code
Code:
StrTxt = ActiveDocument.Path & Application.PathSeparator & .Text & ".docx"
by removing "ActiveDocument.Path & " so that the path isn't included in the filename, so now I get the filename I want.
|
What you've done is not to exclude the path from the filename, but the part that tells Word where to save the file! That part of the code tells Word to save the output file back to the same folder as the input file.
Quote:
is there a way to remove the first 6 characters from the filename, namely "Abcde ", as this would make it perfect.
|
You could use:
Code:
StrTxt = ActiveDocument.Path & Application.PathSeparator & Replace(.Text, "Abcde ", "") & ".docx"
Quote:
Using three test files the last page was missed off in all instances.
|
Try changing:
For i = 1 To .Sections.Count - 1 Step j
to:
For i = 1 To .Sections.Count Step j