scootgp200
Technical User
Hi, I want to automate a web site where word documents can be completed following a set format and an excel spreadsheet would read the document/s and build web pages basedon the word doc formating but need a pointer in the right direction when it comes to interogating the word file.
I have code to read the doc and copy the story.
Dim Word As New Word.Application
Dim WordDoc As New Word.Document
Dim Doc As String
Dim wb1 As Workbook
Dim Fname2 As String
Doc = "E:\work spreadsheets\test1.doc"
Set WordDoc = Word.Documents.Open(Doc)
Word.Selection.WholeStory
Word.Selection.Copy
Sheets("Sheet1").Select
Range("A2").Select
ActiveSheet.Paste
WordDoc.Close
Word.Quit
However what I want to do is read the doc line by line so I can for example pick up the heading 1 and work with that then the heading 2, paragraphs etc and build the web page. I would then hold the heading types in variables to use in building the site navigation.
Can anyone give me some excel vba code that would get me started.
Thanks
I have code to read the doc and copy the story.
Dim Word As New Word.Application
Dim WordDoc As New Word.Document
Dim Doc As String
Dim wb1 As Workbook
Dim Fname2 As String
Doc = "E:\work spreadsheets\test1.doc"
Set WordDoc = Word.Documents.Open(Doc)
Word.Selection.WholeStory
Word.Selection.Copy
Sheets("Sheet1").Select
Range("A2").Select
ActiveSheet.Paste
WordDoc.Close
Word.Quit
However what I want to do is read the doc line by line so I can for example pick up the heading 1 and work with that then the heading 2, paragraphs etc and build the web page. I would then hold the heading types in variables to use in building the site navigation.
Can anyone give me some excel vba code that would get me started.
Thanks