inser picture

B

bryan

I want to insert a tif image on a new page
I have done this with docs using:
Set myDoc = ActiveDocument
With myDoc
.Unprotect
Set docrange = .Range
docrange.Collapse wdCollapseEnd
docrange.InsertBreak wdSectionBreakNextPage
Set docrange = .Range
docrange.Collapse wdCollapseEnd
docrange.InsertFile "W:\Collective Bargaining Letter.doc"
.Protect wdAllowOnlyFormFields, NoReset
End With

How can I inser a tif image after a section break?

Thanks,
Bryan
 
J

Jay Freedman

bryan said:
I want to insert a tif image on a new page
I have done this with docs using:
Set myDoc = ActiveDocument
With myDoc
.Unprotect
Set docrange = .Range
docrange.Collapse wdCollapseEnd
docrange.InsertBreak wdSectionBreakNextPage
Set docrange = .Range
docrange.Collapse wdCollapseEnd
docrange.InsertFile "W:\Collective Bargaining Letter.doc"
.Protect wdAllowOnlyFormFields, NoReset
End With

How can I inser a tif image after a section break?

Thanks,
Bryan

Replace the docrange.InsertFile line with

docrange.InlineShapes.AddPicture "W:\mypic.tif"

with the correct path and filename.

You can also add values for the optional arguments to say whether to link to
the picture and whether to save the picture in the document file. For
example,

docrange.InlineShapes.AddPicture FileName:="W:\mypic.tif", _
LinkToFile:=True, SaveWithDocument:=False

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
B

bryan

If I save the template as wc.doc for example, won't the image be a part of
that document?

Waht is Link to File?

Thanks,
Bryan
 
J

Jay Freedman

Using the LinkToFile and SaveWithDocument arguments (both of which are
optional -- you can leave them out of your code), you can specify any of
three situations:

- When LinkToFile is false, the AddPicture command puts a copy of the
picture into the document file. (In this case, SaveWithDocument is ignored.)
This is the default situation, the one you get when you omit the optional
arguments from the command. The advantage is that you can move the document
around or send it to another computer via email, and the picture won't be
lost. The drawback is that it makes the file bigger -- sometimes a _lot_
bigger.

- When LinkToFile is true and SaveWithDocument is false, all you get in the
document file is a link, in the form of an INCLUDEPICTURE field. The picture
appears on the screen or printout, but only because Word goes out and gets
the file's data each time you open the document. The advantage is that the
file is smaller, but the picture file must be available at the specified
path to avoid getting a blank box on the page.

- When both LinkToFile and SaveWithDocument are true, you get a link to the
picture file _and_ a copy of the picture in the document. The advantage is
that if the picture file is changed (but with the same name and path), you
can just update the link in the document to get the new appearance, and then
save the document to update the copy in the document's disk file. Also,
because the picture is copied into the document, you can send the document
to others and they'll be able to see it. As when LinkToFile is false, the
drawback is larger file size.
 
B

bryan

Thanks for ALL the help and for explaining this.
I cannot give enough kuddos to this Discussion Group.

Thanks,
Bryan
 

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