K
kirkm
Recently I had to re-install Windows and Office and a Word macro I
used a lot now fails. I can't figure our why.
Here's the code :
OpenDoc ("D:\file1.html")
Dim D As Document
Set D = ActiveDocument
Dim msg
Dim LastLine%, i%
LastLine = D.Paragraphs.Count
Dim R As Range
For i = 1 To LastLine ' or less while playing
Set R = D.Paragraphs(i).Range
Debug.Print i, R.Words(1).Bold, R.Words(1).Italic,
R.ParagraphFormat.LeftIndent, R
Next
....
This resides in Doc1.doc and previously I could use any
html file in the OpenDoc line, and read it in the i For
Next Loop.
Now, however, lastline is always 1 and the ActiveDocument
is Doc1.doc whereas it should be file1.html.
Any help appreciated.
Thanks - Kirk
used a lot now fails. I can't figure our why.
Here's the code :
OpenDoc ("D:\file1.html")
Dim D As Document
Set D = ActiveDocument
Dim msg
Dim LastLine%, i%
LastLine = D.Paragraphs.Count
Dim R As Range
For i = 1 To LastLine ' or less while playing
Set R = D.Paragraphs(i).Range
Debug.Print i, R.Words(1).Bold, R.Words(1).Italic,
R.ParagraphFormat.LeftIndent, R
Next
....
This resides in Doc1.doc and previously I could use any
html file in the OpenDoc line, and read it in the i For
Next Loop.
Now, however, lastline is always 1 and the ActiveDocument
is Doc1.doc whereas it should be file1.html.
Any help appreciated.
Thanks - Kirk