Good day all,
I am receiving the runtime error 462 since last week. Nothing has changed, except that the latest updates from Microsoft was loaded.
When ever I run the code for a second time, I receive this error. I have checked several forums and have done all of the suggestions they propose to overcome this issue, but to no avail.
Below is my code when the procedure starts:
Code:
Dim shp As Shape Dim oShp As Object
Dim doc As Word.Document
Dim objWord As Object
Dim objDoc As Word.Document
If IsNull(strdocpath) Or strdocpath = "" Then
Exit Function
End If
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Open(strdocpath)
Set doc = objWord.ActiveDocument
Set oShp = doc.Shapes
The error occurs on this piece of code (on the first line and all of the subsequent lines):
Code:
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.HeaderFooter.Shapes.Range(Array("Text Box 1")).Select
Selection.Font.Size = 10
Any suggestions?
Thanks