View Single Post
  #2  
Old November 28th, 2008, 04:21 AM posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default customised logos

You could do it with a userform with a combobox or even images of each of
the logos and then when the user double clicked on one, code assocated with
that image would change the code in an IncludePicture field in the document
so that the selected logo was displayed.


If you have all of the files for the logos in a folder C:\logo, with a copy
of one of the files also in that folder and saved with the name of logo.jpg,
you could also do it with a macro button field

{ MACROBUTTON Logo { INCLUDEPICTURE "C:\\Logo\\logo.jpg } }

and have the following macro in the template

Sub Logo()
Dim fd As FileDialog
Dim LogoFile as String
Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.Title = "Select the File that contains the Logo"
fd.InitialFileName = "C:\Logo
fd.Filters.Add "Images", "*.jpg", 1
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
LogoFile = .SelectedItems(1)
WordBasic.CopyFileA FileName:=LogoFile,
Directory:="C:\Logo\logo.jpg"
End If
End With
Set fd = Nothing
Selection.Range.Fields.Update
End Sub

When you double click on the logo, a file dialog will open allowing you to
select the file that contains the logo that you want to use and it will then
be displayed in the document.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Michael Hansen" (donotspam) wrote in message
...
Hello

We have a scenario were we have a standard template which needs a
different
company logo which means we need to maintain about 10 templates depending
on
the company/branch needing to use this.

Is there a way where we could allow the user to select which company they
require when they open the document from a drop down box and then a macro
will insert the appropriate company logo into the document.

Regards
Michael Hansen