Article ID: 182679
Article Last Modified on 6/17/2005
Sub Main()
' Set up object variables.
Dim oDoc1 As Object
Dim oRange1 As Object
Dim oInlineShape As Object
Set oDoc1 = Documents.Add
Set oRange1 = oDoc1.Content
Set oRange2 = oDoc1.Sections(1).Headers(1).Range
' Insert the OLE object
Set oInlineShape1 = oDoc1.InlineShapes.AddOLEObject(Range:=oRange2, _
ClassType:="Excel.Sheet.8", LinkToFile:=False, DisplayAsIcon:=False)
End Sub
Sub Main()
' Set up object variables.
Dim oDoc1 As Object
Dim oRange1 As Object
Dim oInlineShape As Object
Set oDoc1 = Documents.Add
Set oRange1 = oDoc1.Content
Set oRange2 = oDoc1.Sections(1).Headers(1).Range
' Must be in page layout to view header.
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = _
wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Or _
ActiveWindow.ActivePane.View.Type = wdMasterView Then
ActiveWindow.ActivePane.View.Type = wdPageView
End If
' View the header.
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
' Insert the OLE object
Set oInlineShape1 = _
oDoc1.InlineShapes.AddOLEObject(Range:=oRange2, _
ClassType:="Excel.Sheet.8", LinkToFile:=False, DisplayAsIcon:=False)
End Sub
181058 OFF98: How to Run Sample Code from Knowledge Base Articles
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: wordcon vb vba vbe
Keywords: kbbug kbmacroexample kbpending KB182679