I want to write an application with VB 6.0.in this application I must take some templates for Ms Word and then according to what user want,one of the templates selected and then change its footer and header and open it for the user.
How can I change header and footer of a microsoft word from visual basic 6.0?internet explorer download
Use following code for changing header footer also further if you explore you can change anything through the VB.
Goto Project--%26gt;Reference--%26gt; select "Microsoft Word 11.0 Object library" yours might be 9.0
Then add following code
Private Sub Form_Load()
Dim MyWord As New Word.Application
MyWord.Documents.Add
MyWord.Documents(1).Sections(1).Header... = "This is header"
MyWord.Documents(1).Sections(1).Footer... = "Hello Word"
MyWord.Visible = True
End Sub
How can I change header and footer of a microsoft word from visual basic 6.0?windows xp internet explorer
Answer of askme is fair enough. But the word version in your system may be different according to your office installation. If you have installed office 2000. It will be word 8 or 9. If it is xp it will be word 10. word 11 is for office 2003
No comments:
Post a Comment