Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed Multi-Page .tif in Word Doc

Status
Not open for further replies.

idbr

MIS
May 1, 2003
247
GB
Hi,

I'm having some problems with embedding multi-page .tif files (generated from a Kodak i260 scanner) into a Word doc. The code below works fine in every respect, other than it only picks up page 1. Can anyone help?

Code:
Sub Test_Pickup_Scanned_Documents()

'======================================
'Embeds scanned .tif file into word doc
'======================================

Dim appWD               As Word.Application

Dim fso                 As FileSystemObject

Dim flScannedDocument   As file

'Grab the scanned document
Set fso = New FileSystemObject
Set flScannedDocument = fso.GetFile("\\LDS-1101\Document Output\577952\120050526160103.tif")

'Instantiate a new instance of Word and hide it from the user
Set appWD = New Word.Application
appWD.Visible = False

'Open the template file
appWD.Documents.Open "C:\Test.doc"

'---------------
'Embed the image
'---------------

'Select the bookmark placholder
appWD.ActiveDocument.Bookmarks("PictureHere").range.Select

'Add the image
appWD.Selection.InlineShapes.AddPicture FileName:=flScannedDocument, LinkToFile _
        :=False, SaveWithDocument:=True

'Save & close the document
appWD.ActiveDocument.Save
appWD.ActiveDocument.Close

'Exit Word
appWD.Quit

'Release the object
Set appWD = Nothing

End Sub

Thanks, Iain
 
It runs from an Access VBA procedure btw...
 
Can you insert a multi page tif file into a Word document manually?

I suspect it's not possible, I've only ever managed to view all pages of a multipage tif in Microsoft's fax viewer or some of the better paint programs, but not the Office suite.

I think it needs to be split into single page files and then inserted.

I'm happy to be proved wrong by someone else, but I think you'll have to work around the problem.

Regards,

Nic
 
Hi idbr,

You can't see more than the first page of a multi-page tiff into Word.

You'll need to split the file into multiple tiffs and then insert each tiff.

Cheers
 
How crap is that?

The reason I'm trying to do this is to get some multi-page .tif files converted to .pdf format. I have Acrobat installed on my system and it's a ridiculously simple process to open and save the file manually.

The problem is that when I try to do it via VBA I can't make head nor tail of the Acrobat API's! I've tried downloading the SDK from adobe.com and just get a 403 error saying I don't have sufficient priveleges to view the content! I've searched the web a thousand times now and can't find anything helpful at all.

Does anyone know where I can get hold of some example VBA code for opening a .tif and saving it as a .pdf that doesn't rely on third party software?

I really need to get this sorted asap, my lead time is extremely short and the deadline is very close...

Thanks, Iain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top