AddPicture

L

Lance Geeck

I have a document that I am creating via VB6. In the middle of the document
I need to add a series of bitmaps.

I am able to get the bitmap to insert, but it always inserts it at the top.
I need it to insert at the bottom of the documnet.

Does anyone have a sample of this?

Thanks
Lance
 
J

Jezebel

At the top of what? -- page? document?

You need to set the anchor, then the position relative to the anchor. If
you're not setting the position, you'll get (0,0) -- top left of page.
 
L

Lance Geeck

Hi Jezebel,

Thanks for responding to my posting.

It is putting it to the top of the document.

I am doing this from within a VB 6 program, below is the code I am using.




Private objWord As Word.Application
' Declare a word app var
Private Range1 As Range
' Range variable to hold reference to Range Object
Private aDoc As Document

Public Sub Main()
Dim sDocName As String
Set objWord = New Word.Application
Set aDoc = New Word.Document
Set Range1 = aDoc.Range
With objWord
.Visible = True ' False
.WindowState = wdWindowStateMinimize
.Documents.Add
sDocName = .ActiveDocument.Name
Set aDoc = .Documents(sDocName)
Set Range1 = aDoc.Range

End With
Range1.InsertAfter "Line 1"
Range1.InsertParagraphAfter
Range1.Collapse (wdCollapseEnd)
' My understanding is this moves to the end
' Of the document. It seems to be working
' correctly with inserting text
Range1.InsertAfter "Line 2"
Range1.InsertParagraphAfter
Range1.Collapse (wdCollapseEnd)
Range1.InsertAfter "Line 3"
Range1.InsertParagraphAfter
Range1.Collapse (wdCollapseEnd)
Range1.Application.ActiveDocument.Shapes.AddPicture "C:\Program
Files\Compliance Data Collector\Maps\aa.bmp", False, True
'insertS the bitmap at the top
' of the document and not at the end!

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top