Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Jul 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am developing a client proposal template in Word 2003. The client name appears in various different locations throughout the document. Is there a way that I can enter the client name once (when I start a new document based on the template) and have Word automatically update all the other locations in the document?

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    One (fairly naff) way would be to put a string like ~~~ in the template, and then do a Replace of all ~~~s with "Mr Joe Bloggs" (or whosoever) just before printing/saving...
    BATcher

    Time prevents everything happening all at once...

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Whilst you can use fields to do what you asked, I would recommend against it if you are delivering the proposal in Word format. It can look pretty ordinary when you use an automatic field which demonstrates clearly to the client that you haven't prepared the proposal exclusively for them.

    However, it can be more efficient to do it this way if you deliver proposals in hard copy or PDF only. There are several methods if you want to use fields to do this.
    1. Put the company name in the document properties. For instance, if you use the Company field then wherever you want the name to appear insert a field with the contents {DocProperty Company}
    2. Bookmark the first occurrence of the company name eg name it ClientName and then wherever you want the name to appear insert a field with the contents {Ref ClientName}
    3. Apply a style to the first occurrence of the company name that is not used anywhere else in the document. If the company name appears in a paragraph by itself such as on the cover then you can use a paragraph style but if not, you might want to create a character style with no attributes. Then use a styleref field such as {StyleRef ClientNameStyle} where ClientNameStyle is the style you used.

    All these methods can work correctly but do require author vigilance to work consistently. Anyone editing the file must remember to update the fields but also they need to ensure that the bookmark doesn't collapse on edits or that the style is applied to the right text. The first method is less prone to people inadvertently breaking it but suffers from authors forgetting how to change the company name since it isn't immediately visible on screen.

    You might also want to consider preparing your template with two versions of the company name. Some companies have a long formal name which is very clumsy in some sentences so you might need to have a "Long Company Name" and a "LCN" which would require only slightly more preparation but give a less formal/stuffy proposal.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    Lounger
    Join Date
    Jul 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks very much for this idea. Will give it a go.

    However, what I was thinking of was something along the lines of a dialog box which appears when I start a new document based on my template whereby the user types the name of the client and when they click on OK, it goes and populates all occurrences of the client name throughout the document. Seems to me that I need to perhaps insert bookmarks at all the points where the client name should appear and then insert the text the user typed in the dialog box in all those locations. The question is how do I get it to do that?!! Any help will be very gratefully accepted.

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    OK, I wouldn't use bookmarks because you have to use a different bookmark name each time. Instead, in your document you should use something unique that is the same each time such as «company» and a simple macro would look like this
    Code:
    Sub AutoOpen()
      Dim strCoy as String
      strCoy = InputBox("Company name")
      BigReplace "«company»", strCoy
    Exit Sub
    Public Function BigReplace(sFind As String, sReplace As String, _
                              Optional bWild As Boolean)
      Dim aStory As Range, myBigString As DataObject
      If Len(sReplace) > 255 Then
        Set myBigString = New DataObject
        myBigString.SetText sReplace
        myBigString.PutInClipboard
        sReplace = "^c"
      End If
      For Each aStory In ActiveDocument.StoryRanges
        Select Case aStory.StoryType
          Case wdMainTextStory, wdFirstPageFooterStory, wdFirstPageHeaderStory, wdPrimaryFooterStory, wdPrimaryHeaderStory
            With aStory.Find
              .ClearFormatting
              .Replacement.ClearFormatting
              .Text = sFind
              .Replacement.Text = sReplace
              .Forward = True
              .Wrap = wdFindContinue
              .Format = False
              .MatchCase = False
              .MatchWholeWord = False
              .MatchWildcards = bWild 'False if empty
              .MatchSoundsLike = False
              .MatchAllWordForms = False
              .Execute Replace:=wdReplaceAll
            End With
        End Select
      Next aStory
    Set aStory = Nothing
    End Function
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    Lounger
    Join Date
    Jul 2006
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much. I made a few amendments/additions and it now does exactly what I want.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •