Mobile menu

Help with restore source macro needed
Thread poster: mmiikkaa
mmiikkaa
English
Feb 10, 2009

HI,

anyone able to adjust the following restore source macro so that it only applies to a text selection wirhin a doc?

thanks,
Miro

Sub RestoreSource()
Selection.HomeKey Unit:=wdStory
With ActiveWindow
With .View
.ShowHiddenText = True
End With
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "(\{\0\>)(*)(\)(*)(\


Direct link Reply with quote
 

Radek Ptak
Local time: 11:08
English to Polish
something like that Feb 10, 2009

I can't see actual replacement in your macro. Did you paste everything?

Anyway, you have to use Range object instead of Selection, for example:

Code:

Set Range001 = ActiveWindow.Selection.Range
With Range001.Find
.Text = "bel bel ble"
.Replacement.Text = "tra la la"
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchWildcards = True
.MatchFuzzy = False
End With
Range001.Find.Execute Replace:=wdReplaceAll




Radek


Direct link Reply with quote
 
mmiikkaa
English
TOPIC STARTER
Hi Radek Feb 11, 2009

Thanks for your reply. When sending the code, part of it got deleted, i dont know why. I will try again here:

Sub RestoreSource() + Selection.HomeKey Unit:=wdStory + With ActiveWindow + With .View + .ShowHiddenText = True + End With + End With + Selection.Find.ClearFormatting + Selection.Find.Replacement.ClearFormatting + With Selection.Find +
.Text = "(\{\0\>)(*)(\)(*)(\


Direct link Reply with quote
 
mmiikkaa
English
TOPIC STARTER
Ooops Feb 11, 2009

seems like I can only use so many characters in my reply. Anyway, should you be willing to help me, I can send you the macro (about 15 lines) to look at.

Direct link Reply with quote
 

Radek Ptak
Local time: 11:08
English to Polish
... Feb 11, 2009

Not a problem! Just send it to me somehow.

Radek


Direct link Reply with quote
 
mmiikkaa
English
TOPIC STARTER
ok, here is my address Feb 11, 2009

p r e kl a d @ p o st.s k

remove all spaces and send me an empty mail, Ill send you the code. As it is now, it restores the source succesfully (minor issues with footnotes) in the whole document.

oh and btw, thumbs up for your helpfulness!

thanks,
Miro


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Help with restore source macro needed

Advanced search


Translation news related to CAT tools





TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
SDL Trados Studio 2017 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2017 helps translators increase translation productivity whilst ensuring quality. Combining translation memory, terminology management and machine translation in one simple and easy-to-use environment.

More info »



All of ProZ.com
  • All of ProZ.com
  • Term search
  • Jobs