Hello, I'm searching the internet to find a solution to copy/move the text from headers and footers into the correct section or to save the html with headers and footers. I do not have any knowledge in VBA, only simple replaces or template modifications.
What I'm trying to do is to convert some PDF to DOC then HTML, but when converting from ACROBAT to word, the same text on different pages remains into the header or footer, and when I convert to html I loose that text, then I must search each page in doc to see what text was in the header or footer, each day day I have 30 PDFs with 32 pages at least, and an archive with over 100.000 pdfs, and it's a terrible task. I've tried to find a solution for this problem for years, and for the past week all I do is read information on different sites to understand what can I do.
Even if I seen some codes on the internet that worked for others, for me they were not good, even though I tried to adapt them but when you do not have the necessary knowledge it's impossible.
What I learned from my docs is that in the header the text is in a text box. What I managed to do until now is the access the text from each page (but it looses the styles/characters and that is not good) and access the headers, but for each page it shows me all the headers, because something I did is not good. I'm trying to find a solution for each page to put the header in front of the text (with the style from the header) and for the footer at the end of text (with the style from the footer).
Please help me with a solution if there is one
Sub testPagini2()Dim oSection As Section
Dim oHeader As HeaderFooter
Dim Shp As Shape, StrTmp As String, testStr As String
Dim textPagina As String
Dim numarShape As Integer
For Each oSection In ActiveDocument.Sections
textPagina = oSection.Range.text
numarShape = ActiveDocument.Sections(oSection.Index).Headers(wdHeaderFooterPrimary).Shapes.Count
MsgBox "Pagina " & oSection.Index & " Numar shape " & numarShape & ": " & textPagina
For Each Shp In ActiveDocument.Sections(oSection.Index).Headers(wdHeaderFooterPrimary).Range.ShapeRange
With Shp
StrTmp = "Name: " & .Name & vbCr & _
"Sus: " & .Top & vbCr & _
"Stanga: " & .Left & vbCr & _
"Inaltime: " & .Height & vbCr & _
"Latime: " & .Width & vbCr
If .TextFrame.HasText = True Then
StrTmp = StrTmp & "Textul din shape: " & .TextFrame.TextRange.text
'End If
MsgBox StrTmp
End If
End With
Next
Next
End Sub