• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Navigate in header of word with Excel VBA

BaranD

New Member
Dear,

I am hoping that you guys can help me with the following: I borrowed an excel macro which makes it possible to navigate in a word file. But i would like to also navigate in the header/footer of a Microsoft word file.

The code I am borrowing to navigate in the word file is:

Code:
Sub EditwordFile()


Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Open("FILENAME")
wrdApp.Visible = True
With wrdDoc


.Application.Selection.Find.Text = "aanvraagbrief"
.Application.Selection.Find.Execute

'now found, lets insert text after
.Application.Selection.InsertBefore "hello there!"

End With
wrdApp.Quit ' close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing
End Sub

I hope you can guys can help me.

Greetings Baran
 
Last edited by a moderator:
Back
Top