Copying WF Classic source segm. to the clipboard w/o selecting it
Thread poster: Rossano Rossi
Rossano Rossi
Rossano Rossi  Identity Verified
Local time: 10:59
English to Italian
+ ...
May 14, 2019

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


 
Samuel Murray
Samuel Murray  Identity Verified
Netherlands
Local time: 10:59
Member (2006)
English to 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)
Ukraine
English to 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: 10:59
English to Italian
+ ...
TOPIC STARTER
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)
Ukraine
English to 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: 10:59
English to Italian
+ ...
TOPIC STARTER
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







Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

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! »