Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-06-2013, 11:12 PM
JohnBi JohnBi is offline Export to Pdf Windows 7 64bit Export to Pdf Office 2007
Novice
Export to Pdf
 
Join Date: Jul 2013
Posts: 1
JohnBi is on a distinguished road
Default Export to Pdf

Hallo to everybody,
browsing the forum I found a sample with the following code and I am trying to modify to get as output a single Pdf file of "iEnd" pages. But without success.
Can you please help?


Thanks and Regards
JohnBi





Sub CertificatePrint()
Dim iStart As Integer, iEnd As Integer, i As Integer
On Error GoTo ErrHandler
With ActiveDocument.Shapes(1).TextFrame.TextRange.Field s(1)
iStart = CInt(InputBox("What is the first Certificate to print?", _
"Print Certificates From", Split(Split(.Code.Text, " ")(0), "=")(1)))
iEnd = CInt(InputBox("What is the last Certificate to print?", _
"Print Certificates To", iStart))
If iStart = 0 Or iStart > iEnd Then Exit Sub
For i = iStart To iEnd
If i = iStart Then
With Application.Dialogs(wdDialogFilePrint)
If .Show = 0 Then Exit Sub
End With
End If
.Code.Text = "=" & i & " \# 000"
.Update
'ActiveDocument.PrintOut
' Next

'---------- export pdf
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
ActiveDocument.Path & "\" & ActiveDocument.Name & ".pdf", ExportFormat:= _
wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False


On Error GoTo ErrHandler
Next

End With
ErrHandler:
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resource Pool / export Bec82 Project 3 08-16-2011 11:11 AM
Import and Export Nwit Outlook 0 11-06-2010 09:57 AM
Export to Pdf Export to Excel with Attachment winseelan Outlook 2 10-27-2010 01:35 AM
Export to Word dr223 Word 1 10-19-2010 07:24 AM
Export/Import Arkmom Outlook 0 03-31-2009 02:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:16 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft