Alpha Video Training
Results 1 to 5 of 5

Thread: How do I open and view a .pdf

  1. #1
    Member
    Real Name
    Jeffrey Walter
    Join Date
    Sep 2006
    Posts
    304

    Default How do I open and view a .pdf

    Hey gang,

    I have a .pdf file that I created from a report. I store the file path of this .pdf file in a embedded browse. I would like to doubleclick on the field that contains the file path and cause the .pdf file at that address to open in Adobe. I'm kinda at a loss on how to open a .pdf in Adobe. I have the following snippit of code:
    Code:
     
    ' Get the name of the object that currently has focus.
    C_Obj = CURRENT_OBJECT()
    ' If the object is "recieved_file" field, open file...
    IF (C_Obj = ":Main:browse_counts:recieved_file") THEN
        ' Open the .pdf, then what? This doesn't display it.
        fp = file.open("C:\Program Files\A5V7 \Attachments\Incoming\\"+:Main:browse_counts:recieved_file, FILE_RO_EXCLUSIVE)
    Where do I go from here?

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: How do I open and view a .pdf

    sys_open("C:\Program Files\A5V7\Attachments\Incoming\\"+:Main:browse_counts:recieved_file.value)

    Your code doesn't indicate that you store the file path as you state. Possibly you meant file name. Depending on what is actually stored you might need.

    sys_open("C:\Program Files\A5V7\Attachments\Incoming\\"+alltrim(:Main:browse_counts:recieved_file.value)+".pdf")
    Last edited by Stan Mathews; 11-08-2006 at 12:30 PM.

  3. #3
    Member
    Real Name
    Jeffrey Walter
    Join Date
    Sep 2006
    Posts
    304

    Default Re: How do I open and view a .pdf

    Quote Originally Posted by Stan Mathews View Post
    sys_open("C:\Program Files\A5V7\Attachments\Incoming\\"+:Main:browse_counts:recieved_file.value)

    Your code doesn't indicate that you store the file path as you state. Possibly you meant file name. Depending on what is actually stored you might need.

    sys_open("C:\Program Files\A5V7\Attachments\Incoming\\"+alltrim(:Main:browse_counts:recieved_file.value)+".pdf")
    Sorry about the ambiguity. I meant to use "recieved_file.value" which stores the filename with extension,
    eg. "whatever.pdf".

    I tried
    Code:
    sys_open("C:\Program Files\A5V7\Attachments\Incoming\\"+:Main:browse_counts:recieved_file.value)
    But nothing happens. I used the debugger to verify that my path string is correct. I do indeed get "c:\program files\a5v7\attachments\incoming\whatever.pdf"

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: How do I open and view a .pdf

    Quote Originally Posted by Jeff@Listbrokers View Post
    Sorry about the ambiguity. I meant to use "recieved_file.value" which stores the filename with extension,
    eg. "whatever.pdf".

    I tried
    Code:
    sys_open("C:\Program Files\A5V7\Attachments\Incoming\\"+:Main:browse_counts:recieved_file.value)
    But nothing happens. I used the debugger to verify that my path string is correct. I do indeed get "c:\program files\a5v7\attachments\incoming\whatever.pdf"

    Sys_open uses the currently registered application for the indicated file type (.pdf here). If you don't have a registered application it would fail.

    For testing try

    Code:
    sys_open("c:\program files\a5v7\attachments\incoming\knownfilename.pdf")
    in the interactive editor.

    If that works you might need to trim the browse field value as indicated earlier (edited post).

  5. #5
    Member
    Real Name
    Jeffrey Walter
    Join Date
    Sep 2006
    Posts
    304

    Default Re: How do I open and view a .pdf

    Turns out it hard to see the trees for the forest when the trees are invisible!!! :) The all powerful alltrim() took care of it. Thanks for the help Stan the man!

Similar Threads

  1. How to use OLE to open a pdf file
    By Mark Jaggers in forum Alpha Five Version 6
    Replies: 3
    Last Post: 07-27-2005, 07:44 AM
  2. Field Rule Lookup Open Dialog View
    By forskare in forum Alpha Five Version 6
    Replies: 2
    Last Post: 08-22-2004, 08:19 AM
  3. can not open form in design or view mode
    By Angie Boutin in forum Alpha Five Version 5
    Replies: 2
    Last Post: 08-08-2003, 08:51 AM
  4. Open PDF File from within alpha
    By crimmelcp in forum Alpha Five Version 5
    Replies: 4
    Last Post: 05-11-2003, 07:49 AM
  5. Help to open .pdf file
    By Tom Patten in forum Alpha Five Version 4
    Replies: 2
    Last Post: 02-12-2003, 08:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •