Where has my copy gone

D

Dave Neve

Hi

I am looking at the following code which should copy text from the footnotes
of the active doc and paste them elsewhere.

But I can't see where the copied text will end up.

Do I have to add lines to this code to specify the doc where the copied text
will be pasted?

Thanks in advance

Sub DuplicateFootNotes()
If ActiveDocument.Footnotes.Count >= 1 Then
ActiveDocument.StoryRanges(wdFootnotesStory).Copy
Documents.Add.Content.Paste
End If

End Sub
 
J

Jay Freedman

Hi Dave

The expression "Documents.Add" causes Word to create a new blank document
based on the normal.dot template. That's where the pasted text will go.

If you want it to go into an existing document, you need to use the
Documents.Open method instead, and pass the filename as a parameter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top