Consulting

Results 1 to 2 of 2

Thread: Entering identical text strings into multiple locations within a document

  1. #1
    VBAX Regular
    Joined
    Jul 2014
    Posts
    79
    Location

    Entering identical text strings into multiple locations within a document

    Hi guys,

    New to VBA & would appreciate some advice...

    I am trying to enter a piece of text into a document at multiple locations. So far, I have tried coding it two seperate ways, both of which I feel aren't ideal.

    Method 1:
    Using bookmarks - This worked great to a point; but as far as I am aware, bookmarks are only used to mark unique locations which meant each occurence of the given text required a different bookmark name. I might be mistaken, but if this is the case then this method is too inefficient.

    Method 2:
    Using a hidden character symbol to mark locations throughout the document - I then tried to perform a 'find & replace'; searching for the hidden symbol & replacing it with my given text string. I found this more difficult to code, especially trying to replace the hidden symbol with 'normal' visible text.

    I can't help thinking there is a better way to accomplish this...I just dont know it lol.

    Is there anything similar to a bookmark that can be used to mark multiple locations within a document but doesn't require a unique name for each location?

    Your help is appreciated,
    Joe

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

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