J
James Pannozzi
Inserting a Bitmap into a Word Header via VBA works perfectly
' 'Insert Logo Into Header (good for all pages)
objWord.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
objWord.Selection.InlineShapes.AddPicture "C:\CGLogo.bmp", False, True
UNLESS the document happens to have a multi-page table in which case
mysterious almost all blank pages appear (with a few table rows on them and
the rest of the
page blank) in the middle of the table on several pages.
The table is a tab seperated text file, read into the document via
InsertFile
and then converted to text via ConvertToTable.
The table is 40 lines to a page, done by the following VBScript:
Dim i
If objWord.ActiveDocument.Tables(1).Rows.Count > 40 Then
For i = 41 To objWord.ActiveDocument.Tables(1).Rows.Count Step 40
objWord.ActiveDocument.Tables(1).Cell(i,1).Range.Paragraphs(1).Format.PageBr
eakBefore = True
Next
End If
Using VBA, I am inquiring:
How insert the bitmap logo without messing up the 40 table rows per page ?
How insert Header text from a file, directly underneath the bitmap logo in
the header
(again, without disturbing the table rows)?
Thanks
Jim
' 'Insert Logo Into Header (good for all pages)
objWord.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
objWord.Selection.InlineShapes.AddPicture "C:\CGLogo.bmp", False, True
UNLESS the document happens to have a multi-page table in which case
mysterious almost all blank pages appear (with a few table rows on them and
the rest of the
page blank) in the middle of the table on several pages.
The table is a tab seperated text file, read into the document via
InsertFile
and then converted to text via ConvertToTable.
The table is 40 lines to a page, done by the following VBScript:
Dim i
If objWord.ActiveDocument.Tables(1).Rows.Count > 40 Then
For i = 41 To objWord.ActiveDocument.Tables(1).Rows.Count Step 40
objWord.ActiveDocument.Tables(1).Cell(i,1).Range.Paragraphs(1).Format.PageBr
eakBefore = True
Next
End If
Using VBA, I am inquiring:
How insert the bitmap logo without messing up the 40 table rows per page ?
How insert Header text from a file, directly underneath the bitmap logo in
the header
(again, without disturbing the table rows)?
Thanks
Jim