Save as PDF file as excel file or text file in vba excel

Hi all,
I am opening a PDF document fromm VBA excel. After opening document it should save the document as excel file or text file in one folder.
I am trying to do this with some code but not able to , pls help me thatnks.
Dim AcroApp As Acrobat.CAcroApp
  Dim Part1Document As Acrobat.CAcroPDDoc
Set Part1Document = CreateObject("AcroExch.PDDoc")
   Part1Document.Open ("Z:\EG MI Information\MIS\Requests\Req_156\NO.1.pdf")
  Dim app As Object, avdoc As Object, pageview As Object
Set app = CreateObject("AcroExch.App")
Set avdoc = app.GetActiveDoc
app.MenuItemExecute ("SaveAs")
thanks
Abhijeet

Hi,
In the documentation for the saveAs function it has the following params
cPath The device-independent path in which to save the file.
cConvID (optional, Acrobat 6.0) A conversion ID string that specifies the conversion
file type.
cFS (optional, Acrobat 7.0) A string that specifies the source file system name.
bCopy (optional, Acrobat 7.0) A Boolean value which, if true, saves the PDF file
as a copy. The default is false.
bPromptToOverwrite (optional, Acrobat 7.0) A Boolean value which, if true, prompts the user if
the destination file already exists. The default is false.
In order to get a text file saved you need to specify the correct cConvID.
See the documentation for the valid convID's - http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/JS_API_AcroJS.88.519.html
Please note the Acrobat SDK contains all the information and does not require much installing ( as it is a zip file(on windows) and a disc image (on Mac) it just needs extracted)
Regards
Malcolm

Similar Messages

  • How I can save an existed Table "exactly" into an Excel or a Text file?

    I am able to save from a Table into an Excel file, but I could not put in it the following:
    a)Column Headers
    b)First column should be integer
    c)The Scientific notation (supposed to be with 6 decimal point) but it shows only two decimal point
    d)In the last 3 rows, it couldn't understand --> it showed Zero's
    ***> It shows better when I changed the data.xls to data.txt ... only solved c)
    ***> You cam modify completely how to write into the Excel or Text file ... but do not change the way I write to the TABLE (I have "no choice" to keep it that way!)
    Attachments:
    Write_Table.vi ‏51 KB

    First of all, the Write to Spreadsheet File function does not create an Excel file. It creates a text file with values separated by a delimiter. Excel is capable of recognizing tabs and commas as delimiters and will convert the text into a spreadsheet.
    Most of your problems can be solved by converting Write to Spreadsheet to accept arrays of strings instead of arrays of numbers and adding the column headers to the array. You'll probably have to experiment with the Excel import function as well.
    Thye best way, however to get exactly what you want into Excel is to use ActiveX. There is an example the4 comes with LabVIEW that shows some of the basics. You can find other examples by searching the Developers Zone. NI also sells a toolkit for reading/
    writing Excel and Word files.

  • How do I populate the choices in a Combo Box in a PDF Form from an Excel spreadsheet or text file?

    Pleasel let me know if there is a way to copy and paste choices for a Combo Box from an Excel spreadsheet or text file.  I have over 250 values I'd like to add and don't trust my typing!
    Thanks for the help!
    Ken K. - 2191

    Yes, using the field.getItemAt method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.745.html
    E.g.:
    var aItems = [];
    var f = getField("combo1");
    for (var i = 0; i < f.numItems; i++) {
        aItems[i] = f.getItemAt(i);
    If there are export values you need to decide how to use the optional bExportValue parameter.

  • Converting Excel Output to Text File (Text(MS-DOS)) in oracle 6i

    I have been able to save Excel Output to Text File (.txt) using OLE. However, I need to save it as TEXT(MS-DOS) specifically due to certain formatting issues.
    Kindly suggest some solution.
    I need it very urgently.
    Thanks!

    Hello Sandy,
    does this mean that you created an Excel file using OLE and named it *.txt?
    And what do you mean by saving as TEXT(MS-DOS)? A csv file?
    Regards
    Marcus

  • All of a sudden if I amend a PDF files title in Goodreader or Save to PDF, then transfer it to iBooks the file shows up in IBooks with the title, UNTITLED. Has anyone else experienced this?

    I change the title of certain files I use for work in Goodreader or Save to PDF then transfer to iBooks for use. All of a sudden no matter what I name the file it turns up in iBooks as UNTITLED. Anyone know why?

    If you add the files to the Books section of your iTunes library, then change the title field by right-clicking and 'Get Info' and then sync it, it should display correctly in iBooks' Library view.
    However, in my experience, it's best that the filename matches the document name as it's the filename (minus the .pdf) that displays as an overlay when you're in Read view.

  • Search and replace data in excel using a text file

    Hi Scripting Guy:
    I was able to write a script based on all the examples in your blogs, but now I'm stuck:
    I have a text file, which has Server Name, IP Address, Comments
    ABCserver1, 1.1.1.1, remote web server
    DEFserver2, 2.2.2.2, remote app server
    XYZserver3, 3.3.3.3, remote api server
    I have a excel file which has Server Name, IP Address, Protocol, Port. Server Name, and IP Addreess can repeat itself more than once in entire spreadsheet at any location: 
    Server1, x.x.x.x, TCP, 80
    Server2, x.x.x.x, TCP, 80
    Server3, x.x.x.x, TCP, 80
    My script search for the excel spreadsheet for a array that I have defined [Server1,Server2,Server3,...], once the first value matches in spreadsheet it replaces all values of Server1 with first value in text file i.e: ABCServer1 so my new excel sheet looks
    this:
    ABCserver1, x.x.x.x, TCP, 80
    DEFserver2, x.x.x.x, TCP, 80
    XYZserver3, x.x.x.x, TCP, 80
    What I also want is, when I replaces the "Server1" value in spreadsheet, it will also replace the IP Address in next column. This is where I'm stuck I can replace the value of Server Name, but I can't replace the IP address for text file. Remember
    "Server1" can be found at any place in spreadsheet but it will always have IP address column next to it.
    So this is what script will do if runs correctly:
    1) Read text file:
    ABCserver1, 1.1.1.1, remote web server
    DEFserver2, 2.2.2.2, remote app server
    XYZserver3, 3.3.3.3, remote api server
    2) Before script run on excel sheet
    Server1, x.x.x.x, TCP, 80
    Server2, x.x.x.x, TCP, 80
    Server3, x.x.x.x, TCP, 80
    3) After script run on excel sheet
    ABCserver1, 1.1.1.1, TCP, 80
    DEFserver2, 2.2.2.2, TCP, 80
    XYZserver3, 3.3.3.3, TCP, 80
    If you will see my script is able to replace "Server Name" in entire spreadsheet, but can't copy or replace the corespondent IP address in next column. 
    script:
    $text = "Server1","Server2","Server3"
    $replace=$replace = get-content C:\script\test.txt | foreach{ ($_.split(","))[0]}
    $File = "C:\script\test.xlsx"
    $now = [datetime]::now.ToString("yyyy-MM-dd")
    #$now = get-date -Format "MM-dd-yyyy_hh:mm:ss"
    copy-Item C:\script\test.xlsx test_$now.xlsx
    # Setup Excel, open $File and set the the first worksheet
    $i=0
    $Excel = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook = $Excel.workbooks.open($file)
    $Worksheets = $Workbooks.worksheets
    $Worksheet = $Workbook.Worksheets.Item(1)
    $Range = $Worksheet.UsedRange
    Foreach($SearchString in $text){
    if ($Range.find("$SearchString")) {
        $Range.replace($SearchString,$replace[$i])
    else {$i++}
    $WorkBook.Save()
    $WorkBook.Close()
    [void]$excel.quit()
    Really appreciate your help
    Thanks

    Hey, thanks for helping me out. I checked online and I had to call Cells this way:
    $Workbook.Worksheets.Item(1).Cells.item($cell.Row,$cell.Column+1)=$test[$i].replace
    one problem I'm having is if the $server value repeats itself in excel sheet again it doesn't replace all values for lets see server 1:
    so thats how my excel sheet is:
    server1
    x
    TCP
    80
    server2
    x
    TCP
    80
    server3
    x
    TCP
    80
    server1
    x
    TCP
    80
    when I run the script thats how results looks:
    server1
    x
    TCP
    80
    REM88888SQL301A
    10.1.1.2
    TCP
    80
    REM88888SQL301B
    10.1.1.3
    TCP
    80
    REM88888SQL301
    10.1.1.1
    TCP
    80
    It skipped the line one on excel and changed value in line 4. As I mentioned above this can repeat $server can repeat itself anywhere in spreadsheet in multiple columns.
    What can we do so it will replace all server name and IP address?
    Thanks

  • Save results of javascript operation to a plain text file

    Hi,
    How do you save to a file using Acrobat javascript? Not a PDF file - I know how to do that - but to a plain text file.
    I have javascript that searches through a PDF document and generates some output. I can send the output to a Report (in PDF format, obviously) or to the console, but I can't see how to send it to a plain text file, which is what I need.
    Any assistance gratefully appreciated.
    Thanks,
    Tim.

    Ah, great, yes that seems to do what I want.
    However, I get an error ...
    My code is as follows:
    function CreateOutput()
         // assembles text and puts it into the variable: output
         // e.g.:
         output = "Hello, world";
    var output = "";
    CreateOutput();
    this.createDataObject("testfile.txt", output);
    Unfortunately I get this error and I don't understand it!
    InvalidGetError: Get not possible, invalid or unknown.
    Doc.pageNum:6:Batch undefined:Exec
    Obviously I'm doing somethign wrong ... but what?
    Thanks very much,
    Tim.

  • How to export report to excel and to text file in previewer

    How to export report to excel?
    And, it takes long time for generate report to rtf or pdf file in previewer.
    How to speed up the process? or, it's better generate report to text file directly by Run_product?
    Please help!

    You can generate report to tab delimite format that can be imported to excel.
    As for the performance question, because reports can't specify what format when you run against previewer, so I don't know what previewer you are talking about. Generate to file is always faster than to your application previewer (assume) because you have one more step after output generated in the file: read from file and render it. Depends on the render and size of the output, it may have significant performance difference.
    Thanks,
    -Shaun

  • How to save the value in Cedit control into a text file bu using measurement studio c++?

    Im using measurement studio c++ to create a application. How to save a randomly generated value which display in the CNumberEdit Control to a text file? how to do the coding part?

    You can use the CNiFile class to write the value out to a file. For example, create a new Measurement Studio C++ project and follow these steps:
    Add a CNiNumEdit to the dialog.
    Add a member variable for the CNiNumEdit called m_numEdit.
    Add a button to the dialog.
    Double-click the button to add a message handler for the button's BN_CLICKED message.
    Add the following code to the button's BN_CLICKED message handler:
    CNiFile file("C:\\Values.log", CFile::modeCreate | CFile::modeWrite | CFile::typeText);
    file << m_numEdit.Value << endl;
    file.Close();
    Run the application, edit the CNiNumEdit's value, and click the button. The value should be written to the Values.log
    file as specified in the code above.
    Hope this helps.
    - Elton

  • Oracle To Excel sheet or text files

    Requirement:
    We might have to get data from different column from different tables based on queries and store it in an Excel or Text files(using delimiters).
    This needs to be scheduled as a daily job. Is there any oracle tools available to do this efficiently?
    I also have chance to do this in Java using Apache POI but would like to know good options available with Oracle itself.
    If the tool is built in with Oracle 10G then it will be good.

    Hello user12094414.
    You've identified two basic requirements; 1) output to a file & 2) output the file daily.
    Some of the current responses already identify several different ways to output to a file. However, unless I'm mistaken, none of these address automating the task.
    Before getting too involved in trying to come up with a solution to a problem that may already have been solved, what tools are already available in your environment to perform automation? Oracle offers a scheduling package in the form of dbms_job, but you'll want to check with your DBAs as to whether this is an approved automation option or not. What OS does the database or remote server run on?
    As with most posts on this forum, the more information that you can provide, the better the response. You'll find that in many environments that the scheduling solution has a direct bearing on the method of data retrieval.
    Best of luck,
    Luke

  • How do I save/export as a TAB or SPACE delimited text file?

    Just upgraded from Apple Works to iWorks. The only text exporting option I see is .csv. Comma separation really screws up my needs. Is there a way to export as plain text? TAB or SPACE delimited?

    Why not using the good old
    --[SCRIPT clipboard2textFile]
    on run
    set tsv to the clipboard as text
    set nomDuFichier to (do shell script "date " & quote & "+P%Y%m%d-%H%M%S" & quote) & ".txt"
    set p2d to path to documents folder as text
    tell application "System Events"
    make new file at end of folder p2d with properties {name:nomDuFichier, file type:"TEXT"}
    end tell -- System Events
    set leDoc to p2d & nomDuFichier
    write tsv to file leDoc
    end run
    --[/SCRIPT]
    I have it installed as:
    <startupVolume>:Users:<my account>:Library:Scripts:clipboard2textFile.scpt
    No need for an extra application.
    Copy to clipboard,
    trigger the script from the menu,
    the text file is available on the desktop.
    Yvan KOENIG (VALLAURIS, France.) lundi 24 août 2009 16:25:13

  • How do i add a download action for dxf files. firefox assumes its a text file and just opens it with no download action dialog box

    I want to add a download action for dxf files so they open in Autodesk trueview. The steps described here (http://support.mozilla.com/en-US/kb/Managing%20file%20types#w_adding-download-actions) say to click on a link for the filetype you want to add an action to but firefox thinks the dxf is a text file and just opens it in a new tab with no download action dialog box.

    Use the right-click context menu and choose "Save Link As" or hold down the alt key and left-click the link.

  • Generating Postscript file using (psl132.prt) and Text file in one go

    Actually my requirement is to have soft copy , postscript files in a single shot for character mode report because the report fetches data from the table then deletes the data.
    - I am able to generate softcopy, and postscript files same using distribution file for Bitmap report as shown below :-
    [RWRUN REPORT=C:\Report\R_TEST.RDF userid = test / test @ test DISTRIBUTE=YES DESTINATION=C:\Report\bRep.dst   ERRFILE=C:\Report\Final\report.err
    The brep.dst file for bitmap report is as follows:-
    DEST1: DESNAME=C:\Report\tpdf.pdf DESTYPE=File DESFORMAT=PDF COPIES=1 LEVEL=Report
    DEST2: DESNAME=C:\Report\test.prn DESTYPE=File DESFORMAT=BITMAP COPIES=1 LEVEL=Report
    But in case of Char mode report i am able to generate text file but i am unable to generate postscript file for using printer definition file. The commands used are as follows :-
    RWRUN REPORT=C:\Report\R_TEST.RDF userid = test / test  @ test DISTRIBUTE=YES MODE=CHARACTER   DESTINATION=C:\Reports\cRep.dst ERRFILE=C:\Report\Final\report.err
    The crep.dst file for char report is as follows :-
    DEST1: DESNAME=C:\Report\tpdf.text  DESTYPE=File DESFORMAT=ASCII   COPIES=1 LEVEL=Report
    DEST2: DESNAME=C:\Report\test.prn  DESTYPE=File DESFORMAT=prt132.prn COPIES=1 LEVEL=Report  (This option does not work is there any work around to make it work) ]
    I am getting an error. it there any work around for this or there is any other solution.
    Is there any other way i convert my text file to postscript file or viceversa...thanks

    Hi,
    Peter Gjelstrup wrote:
    Next thing is how to use it:
    declare
    k_file constant varchar2(30) := 'YourFile.xls'
    begin
    create_file(k_file);
    -- Call other procedures
    close_file;
    end;
    Don't forget: these procedures are all part of the gen_xl_xml package.
    To call them from outside the package, you have to prefix each procedure name with the package name, like this:
    declare
    k_file constant varchar2(30) := 'YourFile.xls'
    begin
    gen_xl_xml.create_file(k_file);
    -- Call other procedures
    gen_xl_xml.close_file;
    end;

  • JavaScript to store the file open count in a text file

    Hi,
    Can we write a javascript in pdf such that when the pdf file is opened, the file open count is stored in a text file locally. Every time, the pdf file is opened, the count should be incremented in the text file. This is basically to check how many time a particular pdf file is opened by an user.
    The text file path should be defined in the javascript.

    Reader is not able to write to a text file, so you will have to use a global persistent variable.
    The script you would use is very simple, and should be set up to run when the document is opened. You can do this by creating a document-level script. The code can look something like:
    // Set up a routine that creates
    // and/or increments a global count
    // variable that keeps track of how
    // many times the document has been
    // opened on this machine
    (function () {
        // Set up the variable name
        // This needs to be unique for each document
        var count_var = "my_doc_open_count";
        // Create global variable if it doesn't already exist
        // and make it persistent
        if (typeof global[count_var] === "undefined") {
            global[count_var] = 0;
            global.setPersistent(count_var, true);
        // Increment the counter
        global[count_var] += 1;
        // Notify user how many times the document has been opened
        // This is mostly for testing, so comment it out if not needed
        app.alert("This document has been opened " + global[count_var] + " times.", 3);
    Read the Acrobat JavaScript reference and the accompanying scripting guide for more information. Note that Reader users may have to enable the use of globally persistent variables for this to work.
    George

  • Compare two text files in Powershell and if a name is found in both files output content from file 2 to a 3rd text file

    Is it possible using PowerShell to compare the contents of two text files line by line and if a line is found output that line to a third text file?
    Lets say hypothetically someone asks us to search a text file named names1.txt and when a name is found in names1.txt we then pair that with the same name in the second text file called names2.txt
    lets say the names shown below are in names1.txt
    Bob
    Mike
    George
    Lets say the names and contents shown below are in names2.txt
    Lisa
    Jordan
    Mike 1112222
    Bob 8675309
    Don
    Joe
    Lets say we want names3.txt to contain the data shown below
    Mike 1112222
    Bob 8675309
    In vbscript I used search and replace commands to get part of the way there like this
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("testing.txt", ForReading)
    strText = objFile.ReadAll
    objFile.Close
    strNewText = Replace(strText, "Mike ", "Mike 1112222")
    Set objFile = objFSO.OpenTextFile("testing.txt", ForWriting)
    objFile.WriteLine strNewText
    objFile.Close
    That script works great when you know the name you are looking for and the correct values. Lets say someone gives you a list of 1000 employees and says import these names into a list in the correct format and one sheet has the correct names only and
    the other sheet has lots of extra names say 200000 and you only need the 1000 you are looking for in the format from names2.txt.

    Sure,
    Here's a simple one:
    $names1 = "C:\names1.txt"
    $names2 = "C:\names2.txt"
    $names3 = "C:\names3.txt"
    Get-Content $names1 | ForEach-Object {
    $names1_Line = $_
    Get-Content $names2 | Where-Object {$_.Contains($names1_Line)} | Out-File -FilePath $names3 -Append
    This basically just reads $names1 file, line by line, and then read $names2 file line by line as well.
    If the line being evaluated from $names2 file contains the line being evaluated from $names1 file, then the line from $names2 file gets output to $names3 file, appending to what's already there.
    This might need a few more tinkering to get it to perform faster etc depending on your requirements. For example:
    - If either $names1 or $names2 contain a lot of entries (in the region of hundreds) then it will be faster to load the whole content of $names2 into memory rather than opening the file, reading line by line, closing and then doing the same for every single
    line in $names1 (which is how it is currently works)
    - Make sure that your comparison is behaving as expected. The .Contains method always does a case sensitive comparison, this might not be what you are after.
    - You might want to put a condition to ignore blank lines or lines with spaces, else they'll also be brought over to $names3
    Hopefully this will get you started though and ask if you have further questions.
    Fausto

  • My Old Illustrator 8 files are being seen as text files..help

    Help...I am needing to go back to some old Illustrator files to update them.
    The problem is that they are are only being seen as 'text' files, and i cannot open them.
    I am running CS3 but have access to CS2 also.
    I have updated to Mac OX version 10.6.6...could this be the problem?

    Add .ai to the filename
    CMD I on the file
    Change open with to AICS3
    While here take a look at the file size (eg:1.6mb in that above screenshot)  is it really small?
    If that don't work try creating a new user account and see if you can open the file.

Maybe you are looking for