Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2007, 06:39 AM
Registered User
 
Join Date: Nov 2007
Location: Bangalore, karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sunilbedre
Default to create PDF from word file

Hi All,

I've a problem while creating PDF from the word document. My concern in the below given code, if i say printtofile=false and giving output file name it consider as prn file. by default it should take the Pdf format. Please can anyone help me.....


Dim Filename As String
    Selection.HomeKey Unit:=wdStory
    ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
    Selection.GoTo What:=wdGoToField, Which:=wdGoToNext, Count:=1, Name:=""
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
    Filename = Selection.Text
    ActivePrinter = "PDF Writer (Ghostscript)"
        Application.PrintOut Filename:="", Range:=wdPrintAllDocument, OutputFileName:="C:\" & Filename &, Item:= _
        wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
        Collate:=False, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
        PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub


Sunil
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create word file in asp.net,c# mohini ASP.NET 2.0 Professional 11 March 1st, 2012 06:38 AM
Dot net - Converting word to pdf and pdf to word Manoah Classic ASP Basics 2 July 7th, 2008 10:21 PM
Convert PDF, Word file to HTML Snowby PHP How-To 0 March 18th, 2008 08:08 AM
Create pdf file using PHP angshujit PHP How-To 1 February 24th, 2007 10:07 AM
create pdf file aytacakin J2EE 1 September 5th, 2005 11:59 PM



All times are GMT -4. The time now is 10:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.