Adding logos to document

T

tonyl

I've concocted the following macro. The idea is that the user prints
the current document onto headed paper but then if they want to email
it (as an attachment) and therefore want the logo on the document the
macro fetches the "pictures" from another document.

1) It feels "cludgy". Is there a more elegant way of achieving this
result?

2) I've tested it on Word 2002. It will be installed (tomorrow?) on
Word 2003 - should I expect it to work?

3) There are around 30 users on a network who need access to it. Is
it better installed locally or on the network? I assume Gobal
templates is where it should go?

4) How do I find out what the picture numbers are? So far I only know
by recording a macro and then seeing the result.

Many thanks.


Sub Letter2Email()
'
' Macro1 Macro
' Macro recorded 25/05/2006 by anthonyl
'
Dim docSource As Document
Dim docDest As Document

Set docDest = ActiveDocument
Set docSource = Documents.Open("L:\letterheadwithlogo.dot")

' Application.Move Left:=115, Top:=25
' ActiveDocument.Shapes("Picture 2").Select
docSource.Shapes("Picture 2").Select
Selection.Copy
docDest.Activate
Selection.Paste
Selection.ShapeRange.IncrementLeft -1
Selection.ShapeRange.IncrementTop -10
docSource.Activate
ActiveDocument.Shapes("Picture 3").Select
Selection.Copy
docDest.Activate
Selection.Paste
Selection.Collapse
docSource.Close wdDoNotSaveChanges

End Sub
 
D

DebsP via OfficeKB.com

You could use an include text field to insert the logo. In the lines below c:
\\MyTemplates\\Logo.doc is the document - it doesn't need to be a template -
containing the logo (you need double backslashes with the include text field)
and 'Letter' is the name of a bookmark enclosing the logo itself.

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"INCLUDETEXT " & "c:\\MyTemplates\\Logo.doc Letter", PreserveFormatting:
=True

Have you looked at using a logo font instead of a picture? Apart from
anything else they take up a lot less space.

Another way would be to save the logos as autotext entries. If you create a
picture, I know that you can give it a name using code (something more
meaningful than Picture1 etc.) & then save it as an atx entry. (I haven't
found a way to name the graphic other than via code.) In this way, when the
logo is inserted you will always know the name of the picture.
 

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