User Profile

Collapse

Profile Sidebar

Collapse
peroron2000
peroron2000
Last Activity: Oct 3 '13, 12:04 AM
Joined: Sep 29 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • how to assign replacement text to string Variable?

    In the following example I am doing a find and replace using a macro inside Word. At the bottom you can see that I assign the searched for text to the variable sText. How would I assign the replacement.tex t to a variable? So for example in this case the macro finds "To:" and replaces it with o. I would like to be able to assign "o" to a variable


    Code:
    Sub Macro6()
    '
    ' Macro6 Macro
    '
    ...
    See more | Go to post

  • Thank Rabbit for getting back to me. Sorry for not using the code tags but I will in the future. I have looked into using regular expressions. I did set my tools to the Microsoft VBScript Regular Expressions 5.5 library but it still won't let me search using "*".

    In the code above I had tried to seach by inserting my variable and assigning the find method (
    Code:
    With sSample.Find
    ) I know that this is not correct but can you tell,...
    See more | Go to post

    Leave a comment:


  • how to use Word find and Replace to search inside a string

    I am trying to figure out how to use the power of Word's Find and Replace to search inside of string variables and then replace the found sequence with something else or in some cases to remove the found item from the variable. I assumed that the following example code would work, in this case I thought it would find 5 numerical digits inside the string variable sSample and remove them but it doesn't seem to work

    Code:
    Sub Macro2()
    '
    ...
    See more | Go to post
    Last edited by Rabbit; Sep 29 '13, 05:33 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
No activity results to display
Show More
Working...