Copying WF Classic source segm. to the clipboard w/o selecting it
论题张贴者: Rossano Rossi
Rossano Rossi
Rossano Rossi  Identity Verified
Local time: 15:30
English英语译成Italian意大利语
+ ...
May 14, 2019

Is this possible?
e.g. by means of any WF variable accessible to VBA


 
Samuel Murray
Samuel Murray  Identity Verified
荷兰
Local time: 15:30
正式会员 (自2006)
English英语译成Afrikaans南非语
+ ...
Probably, but.... May 14, 2019

Rossano Rossi wrote:
Is this possible?


Yeah, probably, but I don't know how. First, however, tell us: what is your segment protection level set to? I mean, if you press Ctrl+A while the cursor is inside the target field, does it select the entire file or only the entire target field? If the latter, then maybe you can record a simple macro that copies source to target, then selects all text and copies it, and then undo x 5, which should get you back your original target text.


 
DZiW (X)
DZiW (X)
乌克兰
English英语译成Russian俄语
+ ...
Simply May 14, 2019

Perhaps, you may want to check PandoraBox for (1) MacroPreSegmentation=_macro_name or (2) Machine Translation--WFMT

Also see SendKeys ^C, playing with False/True optional waiting parameter.

Note, that using something like
If Application.NumLock = True Then ...
may re-use the same macro with different results, as appropriate.


 
Rossano Rossi
Rossano Rossi  Identity Verified
Local time: 15:30
English英语译成Italian意大利语
+ ...
主题发起人
VBA Code to copy WFClassic source segment to the clipboard May 15, 2019

This is a solution I have tested as working and implemented.

Sub CopyWfSourceTextToClipboard()
Dim txt As String
CopyText (ActiveDocument.Bookmarks("WfSource").Range.Text)
End Sub

Sub CopyText(Text As String)
'VBA Macro using late binding to copy text to clipboard.
'By Justin Kay, 8/15/2014
Dim MSForms_DataObject As Object
Set MSForms_DataObject = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
... See more
This is a solution I have tested as working and implemented.

Sub CopyWfSourceTextToClipboard()
Dim txt As String
CopyText (ActiveDocument.Bookmarks("WfSource").Range.Text)
End Sub

Sub CopyText(Text As String)
'VBA Macro using late binding to copy text to clipboard.
'By Justin Kay, 8/15/2014
Dim MSForms_DataObject As Object
Set MSForms_DataObject = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
MSForms_DataObject.SetText Text
MSForms_DataObject.PutInClipboard
Set MSForms_DataObject = Nothing
End Sub

Thanks for your support.

[Edited at 2019-05-15 13:28 GMT]
Collapse


 
DZiW (X)
DZiW (X)
乌克兰
English英语译成Russian俄语
+ ...
Read the manual May 15, 2019

@Rossano, unlike wordfast.com or wordfast.net, the ProZ is but a translation-related forum.

As for copying the source segment, depending on your needs you may (1) check PandoraBox options, (2) simulate keyboard shortcuts (e.g. "^A" & "^C") or just (3) add a MT macro
Sub WFMT
Selection.Copy
End Sub


 
Rossano Rossi
Rossano Rossi  Identity Verified
Local time: 15:30
English英语译成Italian意大利语
+ ...
主题发起人
PB Setting May 15, 2019

I have set in the PB

MacroPreSegmentation=CopyWfSourceTextToClipboard

and after opening a segment in WF, I get the source text in the clipboard.

That is it.





[Edited at 2019-05-16 12:11 GMT]


 


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


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

Copying WF Classic source segm. to the clipboard w/o selecting it







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 »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »