Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting from PDF
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01649292
Message ID:
01649325
Views:
56
for your purpose (copy text paragraphs from pdf to word) this is a simple code to do that
can be any text in clipboard from any extension file also...it use the clipboard.
*!*	copy any text here from acrobat pdf file (or any selected text from any file) and run this code.
*!*	it paste the text (only the ext) content clipboard in word (ypaste.doc file).the file stays opened here.
*!*    word must be installed on system and no need to any framework.

_screen.windowstate=1
local m.yrep
m.yrep=addbs(justpath(sys(16,1)))
set defa to (yrep)

#Define wdCollapseEnd 0
#Define wdFormatHTML 8
m.retVal=.t.
local  loWord
Try
	loWord = Createobject("word.application")  &&invisible here
    loWord.visible=.t.  &&can be invisible...uncomment lines below 
Catch
	m.retVAl=.F.
	Messagebox("This code needs Word to be installed mandatory !......cancelling",16+4096,"Error")
Endtry

If m.retVAl=.F.
	Return .F.
Endi


*!*word
ActiveDocument = loWord.Documents.Add()
ActiveDocument.Activate
oRange = ActiveDocument.Range()
oRange.Collapse(wdCollapseEnd)
myRange = ActiveDocument.Range (ActiveDocument.Content.End - 1,ActiveDocument.Content.End - 1)
myRange.Paste()  &&paste the data in the clipboard to word
ActiveDocument.SaveAs(m.yrep+"myPaste.doc")
*ActiveDocument.Close()
*loword.quit
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform