Hi Guy's I have found this code then adapted to my folders and files etc....
This converts word to jpg, appears to do the job nicely, however when i try and open the jpg file after conversion in MS Paint, it says:
Paint cannot read this file, this is not a valid bitmap file, or its format is not currently supported
When I have gone into the property of another JPG file, it opens fine in paint, yet the file extension looks the same, eventually i am going to try and:
Convert a document to jpg
Add to email body (i can achieve this part once the file opens with MS Paint)
Code:
Dim WDDoc As ObjectDim WD As Object
Dim strPath As String, strFile As String, strJPGFile As String
strPath = "T:\DMT Ltd\Word Docs\Word To JPG\"
strFile = "Absence Request Form.docx"
strJPGFile = Replace(strFile, ".docx", ".jpg")
WDarray = Array("txtCompName", "txtCompNo", "txtCompRef", "txtRefTitle", _
"txtCompName", "txtStorage", "txtSpecial", "txtCompRef", "txtSafeRef", "txtStreet", "txtStreetNo", "txtPostNo", "txtCity")
Set WD = CreateObject("Word.Application")
WD.Visible = True
Set WDDoc = WD.Documents.Open(strPath & strFile)
Set objSelection = WD.selection
WD.Activate
WDDoc.ExportAsFixedFormat strPath & strJPGFile, 17 ' 17 is wdExportFormatPDF
WDDoc.Close
WD.Quit
Set WDDoc = Nothing
Set WD = Nothing
Application.FollowHyperlink strPath
This converts but unsure why a JPG wont open in pain due to file extension!!!
I am going to try BMP format
Any ideas if there is a better option than my adapted code ?