Re: Cannot get rid of footnotes
From: Grant (gpsnett_at_hotmail.com)
Date: 04/14/04
- Next message: Charles Kenyon: "FAQ - please read before posting - Frequently Asked Questions - unofficial - April"
- Previous message: Steved: "Re: Text. Replacment.Text"
- In reply to: Doug Robbins - Word MVP: "Re: Cannot get rid of footnotes"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Apr 2004 12:35:08 +1000
Hi Doug,
Well that is truly bazaar. Here is the original macro I wrote to 'delete'
the footnotes( from now on Ill be deleting footnote references instead of
just the footnote object):
-------------------------------------
' Delete_Footnotes Macro
' Macro created 17/03/04 by GrantS
'
'Declerations
Dim strDirectory As String
Dim objSystemObject
Dim objFile
Dim obfFolder
Dim objDocument As Document
'Set the file system object
Set objSystemObject = CreateObject("scripting.filesystemobject")
'Get directory from the file system object
strDirectory = ActiveDocument.Path & "\"
Set obfFolder = objSystemObject.getfolder(strDirectory)
'Loop through files
For Each objFile In obfFolder.files
Set objDocument = Documents.Open(objFile.Path)
'Loop through and Delete all footnotes
For Each objFootnote In objDocument.Footnotes
'objDocument.Footnotes.Item.Delete
'On Error Resume Next
objFootnote.Delete
Next objFootnote
'Save and close and move on to next
objDocument.Save
objDocument.Close (savechanges)
Next objFile
MsgBox "Finished"
------------------------------------------------
Thank you for finding a solution to this - I would never have figured that
out.
Cheers,
Grant
"Doug Robbins - Word MVP" <dkr@NOmvpsSPAM.org> wrote in message
news:ODWc7ubIEHA.3832@TK2MSFTNGP12.phx.gbl...
> Hi Grant,
>
> Somehow, the last letter of each word was the footnote reference.
>
> Running just
>
> Dim afootnote As Footnote
> For Each afootnote In ActiveDocument.Footnotes
> afootnote.Reference.Delete
> Next
>
> deleted the footnote and the last letter of each word. That's why I had
to
> declare a variable mytext, set it to the footnote reference and then
insert
> that before the reference so that the reference could be deleted while
> leaving the word intact.
>
> Dim afootnote As Footnote, mytext As String
> For Each afootnote In ActiveDocument.Footnotes
> mytext = afootnote.Reference.Text
> afootnote.Reference.InsertBefore mytext
> afootnote.Reference.Delete
> Next
>
> I have no idea how the last letter of the word came to be the footnote
> reference. Though I could write a macro to do it.
>
> --
> Please post any further questions or followup to the newsgroups for the
> benefit of others who may be interested. Unsolicited questions forwarded
> directly to me will only be answered on a paid consulting basis.
>
> Hope this helps
> Doug Robbins - Word MVP
> "Grant" <gpsnett@hotmail.com> wrote in message
> news:uX6h4UVIEHA.3556@TK2MSFTNGP10.phx.gbl...
> > Thank you, Thank you, Thank you! Sorry for the outburst but Word just
got
> > the better of me in the end. As an IT admin person I know all too well
> about
> > the issue of viruses so I know exactly where Uncle Joe is coming from -
I
> > was faced with going through about 50 documents none of which are less
> than
> > 4 megs, and manually removing all these references - that combined with
> > seeing this error message about 100 times: 'that is not a valid action
for
> > footnotes' is what nearly caused my insanity - Im not implying sanity
> > either - something in between though.
> >
> > Could you tell me what the problem was?
> >
> >
> > "Doug Robbins - Word MVP" <dkr@NOmvpsSPAM.org> wrote in message
> > news:O3Xtz$UIEHA.580@TK2MSFTNGP12.phx.gbl...
> > > Grant,
> > >
> > > Attachments are not permitted in newsgroups that do not include the
word
> > > binaries in the title of the newsgroup.
> > >
> > > The comments that Uncle Joe has made did not preclude two other people
> > from
> > > trying to help you. However, knowing those people, I know that they
> would
> > > not open your attachment. Sometimes however, I am prepared to play
> > Russian
> > > Roulette
> > >
> > > Run the following macro and it will get rid of the footnotes.
> > >
> > > Dim afootnote As Footnote, mytext As String
> > > For Each afootnote In ActiveDocument.Footnotes
> > > mytext = afootnote.Reference.Text
> > > afootnote.Reference.InsertBefore mytext
> > > afootnote.Reference.Delete
> > > Next
> > >
> > >
> > > --
> > > Please post any further questions or followup to the newsgroups for
the
> > > benefit of others who may be interested. Unsolicited questions
> forwarded
> > > directly to me will only be answered on a paid consulting basis.
> > >
> > > Hope this helps
> > > Doug Robbins - Word MVP
> > > "Grant" <gpsnett@hotmail.com> wrote in message
> > > news:e4C5qLUIEHA.364@TK2MSFTNGP11.phx.gbl...
> > > > Your stupid comments about bugs in my document have probably
prevented
> > me
> > > > getting a solution to this problem. Ive had to post 5 times to try
and
> > > > describe the problem when all it would take is someone to open the
> > > document
> > > > and see for themselves. I have NAV with the latest definitions - and
a
> > > virus
> > > > free computer. If you had any sense you would too. That said, is it
so
> > > > difficult to save the document and virus scan the thing? If that is
> done
> > > and
> > > > you disable macros then what damage can a Word doco do? You didnt
even
> > > > attempt a solution. Whats the difference betweeen saving it to your
> > > computer
> > > > from a public URL or from an attachement?
> > > >
> > > >
> > > > "Uncle Joe" <Uncle Jose@anonymous.net> wrote in message
> > > > news:eD08jJPIEHA.3248@TK2MSFTNGP12.phx.gbl...
> > > > > Please don't attach documents. We have no idea
> > > > > what kind of "bugs" could be in your document.
> > > > >
> > > > > If you have a website, paste the documents
> > > > > there and give us the URL(s) thereof.
> > > > >
> > > > > If not, simulate the footnote text in another note.
> > > > >
> > > > > I, for one, won't go near an attachment. Sorry.
> > > > >
> > > > > "Grant" <gpsnett@hotmail.com> wrote in message
> > > > > news:uBuXr8OIEHA.3044@TK2MSFTNGP10.phx.gbl...
> > > > > > Hello,
> > > > > >
> > > > > > Ive attached a document which contains a few examples of
footnotes
> > > > > that I
> > > > > > dont know how to get rid of. The footnotes attach to words -
> unlike
> > > > > what I
> > > > > > am used to where numbers usually appear next to the words that
> > > > > contain
> > > > > > footnotes. As you can see in the footnoes section there is
nothing
> > > > > except a
> > > > > > full stop which links to words in the main document?
> > > > > >
> > > > > > This is very confusing and I cant seem to get rid of the
footnotes
> > > > > section.
> > > > > > Can anyone show me how to clear the document of all these
> > > > > references?
> > > > > >
> > > > > > Thanks for any help,
> > > > > > Grant
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>
- Next message: Charles Kenyon: "FAQ - please read before posting - Frequently Asked Questions - unofficial - April"
- Previous message: Steved: "Re: Text. Replacment.Text"
- In reply to: Doug Robbins - Word MVP: "Re: Cannot get rid of footnotes"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|