Hi everyone, Wishing you all a belated very happy new year.
I am using the below code to extract data from PDF to Excel. I have only reached partway through the process - opening the PDF as word Doc.
I have the code to copy and paste the data in excel from the converted word doc but the problem I face is that the data from the PDF when converted to Word looks like what I have pasted below.
"%PDF-1.3
3 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/Contents 4 0 R>>
endobj
4 0 obj
<</Filter /FlateDecode /Length 3393>>
stream
xœ\ÛrÛ8}÷Wà1(c)ZCxÏ›bˉ&‰â••LmU^›Ž5-E‡-&å¿_€$Ø µSµã
Ð
Ý
Ràò×£IFþœ1/2ßÙ')eŒlîÉbsö›Ä Âä?' B'e4g$ËSZäö‰Ì-œ\Ö俺5gÐ\ ÙLveR²¹#o>|ý3/4X¯3/4,VòõŠ|Z¬çŸçoÉæŸ3/4ÁìJÂî"‹i*"HmÕùÅGÙje4ky$K8x
úñf³&\ù·V÷ÜéžrÀ²e"Q-÷-oªŠ4Ç]%G#~1/4!*äÇ[Rîïdw1(c)ïɧª)w%94Uùrl^Ém}W!/F-dèÌÿo~qÊ#tAr@‹1/4i''Ò(tm)iÁUvä†8õrÄ,Ò&Ô÷
t1/2Ñþ·Læ/"ýF'‚8"éïâúa1/2"ý( ¡3ËÕá'cfº¶K"áÜbã
ì'ˆæ(c)ÉîÓgƲ"(tm)Ô"ÿð...ÃÕŠ"f¯")û>ãqFc)a-Q(tm)NN"œœgÊ}S'{Y[Ð,×µŒf...U+Yeq¸6¥œ‡kåßEÐoÚ†..........................................
Can anyone tell me why this is and how to get around this.
I am using MS Word 2010 and MS Excel 2010
Thanks in advance.
I am using the below code to extract data from PDF to Excel. I have only reached partway through the process - opening the PDF as word Doc.
I have the code to copy and paste the data in excel from the converted word doc but the problem I face is that the data from the PDF when converted to Word looks like what I have pasted below.
"%PDF-1.3
3 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/Contents 4 0 R>>
endobj
4 0 obj
<</Filter /FlateDecode /Length 3393>>
stream
xœ\ÛrÛ8}÷Wà1(c)ZCxÏ›bˉ&‰â••LmU^›Ž5-E‡-&å¿_€$Ø µSµã
Ð
Ý
Ràò×£IFþœ1/2ßÙ')eŒlîÉbsö›Ä Âä?' B'e4g$ËSZäö‰Ì-œ\Ö俺5gÐ\ ÙLveR²¹#o>|ý3/4X¯3/4,VòõŠ|Z¬çŸçoÉæŸ3/4ÁìJÂî"‹i*"HmÕùÅGÙje4ky$K8x
úñf³&\ù·V÷ÜéžrÀ²e"Q-÷-oªŠ4Ç]%G#~1/4!*äÇ[Rîïdw1(c)ïɧª)w%94Uùrl^Ém}W!/F-dèÌÿo~qÊ#tAr@‹1/4i''Ò(tm)iÁUvä†8õrÄ,Ò&Ô÷
t1/2Ñþ·Læ/"ýF'‚8"éïâúa1/2"ý( ¡3ËÕá'cfº¶K"áÜbã
ì'ˆæ(c)ÉîÓgƲ"(tm)Ô"ÿð...ÃÕŠ"f¯")û>ãqFc)a-Q(tm)NN"œœgÊ}S'{Y[Ð,×µŒf...U+Yeq¸6¥œ‡kåßEÐoÚ†..........................................
Can anyone tell me why this is and how to get around this.
I am using MS Word 2010 and MS Excel 2010
Thanks in advance.
VBA Code:
Sub PDF_To_Word()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Sheet1")
Dim fso As New FileSystemObject
Dim fo As Folder
Dim f As File
Dim wordApp As New Word.Application
Dim wordDoc As Word.Document
Dim PDF_path As String
Dim Word_path As String
PDF_path = sh.Range("F4").Value
Word_path = sh.Range("F5").Value
wordApp.Visible = True
Set fo = fso.GetFolder(PDF_path)
For Each f In fo.Files
Set wordDoc = wordApp.Documents.Open(f.Path)
wordDoc.SaveAs2 (Word_path & "\" & Replace(f.Name, ".pdf", ".doc"))
wordDoc.Close False
Next f
End Sub