PDA

View Full Version : How to append specific *.tif image with another tif file through Word VBA



aarun2
04-07-2014, 10:03 AM
Hi All,
This is the first time, i am using this site. I hope i will get my question answered. Thanks in advance for all your support.
Here is what i want: I am doing an automation in Word to print the document as Tiff file as well as i would like to append certain tiff images with the same. I tried with below code, but i am not able to find how to append the tiff image, Please help me!
Set sPrinter = CreateObject("Word.Application")
sPrinter.ActivePrinter = "Informatik Image Driver 3.50"

With ActiveDocument
.PrintOut Background:=True, OutputFileName:=FNPath, Collate:=True, PrintToFile:=True
End With
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "Tiff Image", "*.tif"
.Title = "Select the File that you want to append"
.InitialFileName = "G:\Everyone\Letter Automation Testing - DO NOT DELETE"
.InitialView = msoFileDialogViewList
Set FiletoInsert = .SelectedItems
FiletoInsert.PrintOut Background:=True, Append:=True, OutputFileName:=FNPath, Collate:=True, PrintToFile:=True

End With

macropod
04-08-2014, 03:20 PM
Cross-posted at: http://www.msofficeforums.com/word-vba/20510-how-append-specific-tif-image-another-tif.html
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

If you want to include other TIFF images in the output, consider saving the document then adding the images to it document before printing. You can always close the document without saving afterwards, so the TIFF images don't remain with it.

fumei
04-08-2014, 10:15 PM
Perhaps if you clarified "append". Do you mean just add a new TIFF to the end? If so, then macropod's suggestion seems appropriate. Add the new TIFF and print the file. Why do think you need a VBA solution?