View Single Post
 
Old 07-26-2011, 07:02 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Niels,

There are various ways of approaching this, using a 'Document_New' macro in the template's 'This Document' module. For example, if you just want text such as a name & address:
Code:
Private Sub Document_New()
Dim Rslt
With ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range
  While Not Rslt Like "[1-5]"
  Rslt = InputBox("Which company's details should appear?" & vbCr & "Please input the corresponding number." & vbCr & _
      "1: Company A" & vbCr & _
      "2: Company B" & vbCr & _
      "3: Company C" & vbCr & _
      "4: Company D" & vbCr & _
      "5: Company E")
  Wend
  Select Case Rslt
    Case 1: .Text = "Company A Name" & vbCr & "Company A Address"
    Case 2: .Text = "Company B Name" & vbCr & "Company B Address"
    Case 3: .Text = "Company C Name" & vbCr & "Company C Address"
    Case 4: .Text = "Company D Name" & vbCr & "Company D Address"
    Case 5: .Text = "Company E Name" & vbCr & "Company E Address"
  End Select
End With
End Sub
Additional code would be required to add a graphic from a file, but the idea is the same.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote