The code below creates a PDF file from Excel of a Word document. The name of the file is exactly the same except it has a 'pdf' extension rather than 'docx'. The ", 17" at the end of the last line of code gives it the 'pdf' extension.
The file is 3 pages.
The main thing I would like to do is create 2 PDF files - one is of just the first page and the other is of pages 2-3.
I don't know what the code is to specify page ranges.
The other thing I would like to do is suppress the message that comes up when the second from last line of code is executed - i.e. the one that opens the Word file. It currently says the file is locked for editing and has 3 options for opening the file. I just want to open the file as read-only (which is option 1).
Also can you tell me how to add this code properly to the thread? At the moment I have just pasted it in from the VBA editor.

Many thanks
David

Sub Create_PDF_File_of_Word_Document()

Dim wordFile As Object
Set wordFile = CreateObject("Word.Application")

Directory_Path = "C:\Data"
Filename = "Jul-15 Variance Analysis.docx"

Set wordDoc = wordFile.Documents.Open(Directory_Path & "\" & Filename)

wordDoc.ExportAsFixedFormat Left(wordDoc.FullName, InStrRev(wordDoc.FullName, ".") - 1), 17

End Sub