Global Text Replacement

Microsoft OFFICE

    Sponsored Links

    Next

  • 1. OfficeXP and 2003 backwards compatibility
    Hi everyone, Does anyone have any idea what amount of *core* functionality in the more recent versions of Office, is available as far back as offive 97 and at least 2000. By "core" I mean the non-fancy - XP/2003 options like smart tages and so on. Do you think I would find it easy enough to make sure that stuff i develop on office 2003 still works on older copies, as long as i make sure that I am not using any functions added in the more advanced editions. Also, I am using VBA and not VSTO as i would really really like to. Are their any key differences between VBA in the two most recent editions of office, and 97/2000. Thanks everyone Take care
  • 2. Call GetFile Name DLL
    I would like a sample VBA code to call a Windows API DLL that returns a file name to an Access VBA program. Ideally, the user would click a button on an Access form, the file open dialog box would appear, the user would navigate through the directories until they found the file, they would click OK, and the file name (and path) would be returned. How can I do this in VBA? Thank you.
  • 3. email signature...Urgent
    Hi Friends, I have to insert the default email signature(Signature which was set by using Tools->Options->Email Options in General tab) programetically in a opened Word document. I have a button,on click of which i have to insert the default signature set for the New mail message. I am able to get the Signatures name by using appWord.EmailOptions.EmailSignature.NewMessageSignature ->(C#) but i want the contents of the signature. Any help will be appreciated. Waiting for reply, Ramaprasad Upadhyaya
  • 4. Integration with Outlook
    Hi, Slightly off topic as I am working in VB6. Can anyone tell me or point me to information on integrating a stand alone VB6 app with the Outlook calender and contact list. Thanks Marcus

Global Text Replacement

Postby Steve Cronin » Thu, 16 Mar 2006 17:05:39 GMT

Folks;
What I want to do is to replace ALL occurrences of 'ABC' with 'XYZ'.
When I say ALL I mean ALL.
Occurrences in the mainDocument, Headers, Footers, TextBoxes, TextBoxes

in Headers,  TextBoxes in Footers, Tables, Tables in Headers, and
Tables in Footers.

This on a Mac using 'do Visual Basic'.  I've posted something in the
Mac forum and it seems as soon as I mention 'do Visual Basic' I get
pointed over here.

Anyway a simple Find/Replace doesn't scour the text of Tables nor
TextBoxes, though I've been told it should? could?

The code below does what I need except for one small thing ...
It doesn't work when I change the ActivePane to wdSeekPrimaryHeader or
wdSeekPrimaryFooter

So I've got it working MainDocument but the code goes brain-dead in
Headers and Footers...
Can someone point out what I need to do?

Also the code below has an odd nested construct.  I found similar code
in the MSHelp files.
Can someone clarify why the For .. While Not ..  Wend Next construct is

necessary?
The code doesn't work in I unwind it to a simple For Next loop.

Thanks!
Steve
_____________________________
ActiveDocument.ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
For Each myStoryRange In ActiveDocument.StoryRanges
   myStoryRange.Find.Execute
FindText:="ABC",ReplaceWith:="XYZ",Replace:=wdReplaceAll
           While Not (myStoryRange.NextStoryRange Is Nothing)
        Set myStoryRange = myStoryRange.NextStoryRange
        myStoryRange.Find.Execute FindText:=
"ABC",ReplaceWith:="XYZ",Replace:=wdReplaceAll
     Wend 
Next myStoryRange


Similar Threads:

1.Global Text Replacement

Folks;

What I want to do is to replace ALL occurrences of 'ABC' with 'XYZ'.
When I say ALL I mean ALL.
Occurrences in the mainDocument, Headers, Footers, TextBoxes, TextBoxes
in Headers,  TextBoxes in Footers, Tables, Tables in Headers, and
Tables in Footers.

This on a Mac using 'do Visual Basic'.  I've posted something in the
Mac forum and it seems as soon as I mention 'do Visual Basic' I get
pointed over here.

Anyway a simple Find/Replace doesn't scour the text of Tables nor
TextBoxes, though I've been told it should? could?

The code below does what I need except for one small thing ...
It doesn't work when I change the ActivePane to wdSeekPrimaryHeader or
wdSeekPrimaryFooter

So I've got it working MainDocument but the code goes brain-dead in
Headers and Footers...
Can someone point out what I need to do?

Also the code below has an odd nested construct.  I found similar code
in the MSHelp files.
Can someone clarify why the For .. While Not ..  Wend Next construct is
necessary?
The code doesn't work in I unwind it to a simple For Next loop.

_____________________________
ActiveDocument.ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
For Each myStoryRange In ActiveDocument.StoryRanges
   myStoryRange.Find.Execute
FindText:="ABC",ReplaceWith:="XYZ",Replace:=wdReplaceAll
	   While Not (myStoryRange.NextStoryRange Is Nothing)
        Set myStoryRange = myStoryRange.NextStoryRange
        myStoryRange.Find.Execute FindText:=
"ABC",ReplaceWith:="XYZ",Replace:=wdReplaceAll
     Wend
Next myStoryRange

2.Global Replacement of Test to Display

I have a large number of hyperlinks previousely created in worksheets in a 
form the text to display is always different from its actual address. Now I 
am looking for a 'programable' way to replace all the text to display with 
their actual addresses, rather than manually change it one at a time by 
editting the hyperlinks using GUI. Your knowledge and experience will be 
greatly appreciated. Thanks you very much.

3.Global Table Grid Replacement

I have a Word document that contains 725 tables; each table has six columns. 
Not all tables have the columns the same width. I could go through each table 
and change the table properties, but that would take days.
I tried recording a macro that would include changing the table properties, 
but it didn't work.

Is there a way to globally change the table properties on all of the tables 
in the document so that all of the columns in all of the tables are the same 
width?

4.Global Replacement of special characters

Hi.

I have a Word (Office 97) document with a series of boxes 
created by using tables. The user is supposed to insert 
a "tick" symbol in the appropriate box, in response to 
questions. They have inserted the incorrect symbol, using 
Webdings instead of Wingdings.

I tried to do a global replacement using the "Replace" 
option in the "Edit" menu but could not pick up the 
Webdings symbol or the desired Wingdings symbol.

Does anyone know how I can do this global replacement in 
Word?

5.Office XP (Text Deleting and Text Replacement Inconvenience)

The way things are deleted using the Office XP is worse 
than all prior versions of Office. That is when you are 
typing something, and want to highlight a portion of what 
was typed, then instead of clicking delete, then typing 
something over what was deleted (a 2-step process), you 
simply highlight a text, then type over it (one-step 
process). 

With Office XP it is very inconveniencing, as when you 
type over a highlighted text, the text you wanted to 
delete does NOT get deleted. Is there a way this could be 
fixed -- i.e. so taht the one-step process describe above 
could again be performed successfully with Office XP?

Thanks
-Chuka

6. Any way to install replacement instance of Outlook on replacement

7. script for multi text replacement

8. text replacement



Return to Microsoft OFFICE

 

Who is online

Users browsing this forum: No registered users and 70 guest