Okay, i dislike using VB but for a certain assignment i must.
I want to have a button open a pdf file, it doesnt need to be in visual basic, i wud prefer it was clicked and then it loaded up in Acrobat.
I have the address of where the file is... and i know that obviously has something to do with it.
slap me if its that easy....
Leon
9 9771
well you can always use shell commands to open up the file (same commands as say the command window) or you can CreateObject("PDF.PdfCtrl.5") (i think thats right) but the latter will view within your vb program. I think if you just want to open adobe to view a shell command would be easiest
SammyB 807
Recognized Expert Contributor
In .Net, it looks like: -
Dim pRun As System.Diagnostics.Process = New System.Diagnostics.Process
-
pRun.StartInfo.FileName = "C:\SomePath\TheFile.pdf"
-
pRun.StartInfo.UseShellExecute = True
-
pRun.Start()
-
Im using VB6... not sure if that helps.
im not sure on any of this shell stuff.... you might have to babyfeed it to me until i have something i recognise.
Sorry
Leon
easy enough
basically its
Shell(pathname, window style)
pathname as string
window style i would recommend either
vbMaximizedFocus -maximize it and focus
vbNormalFocus -open normal and focus
SammyB 807
Recognized Expert Contributor
Im using VB6... not sure if that helps.
im not sure on any of this shell stuff.... you might have to babyfeed it to me until i have something i recognise.
Sorry
Leon
No problem, it's just a one liner, something like this:
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32 C:\Documents and Settings\cheryltest\My Documents\ArcMap.pdf", vbNormalFocus
IE
Shell "ReaderPath DocFileSpec", WindowState
Thanks for the help guys, much apprieciated
No problem, it's just a one liner, something like this:
Shell "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32 C:\Documents and Settings\cheryltest\My Documents\ArcMap.pdf", vbNormalFocus
IE
Shell "ReaderPath DocFileSpec", WindowState
Ok, first please forgive me for being a noobie. I am working on a VB6 program to be included in a business CD. The goal is to burn it and the related .pdf files to a CD to be able to distribute to vendors and clients. Basically a autostart CD menu. VB6 is what I have to work with, not by choice.
The code lines above will open a specific version of A.R. if installed into a specific place. I need one that will open the AcroRd32 file in much more generic fashion. Is there a way to do this, so that no matter what version they have it will open the .pdf file with the "Windows default"?
This is what I have so far. It works if and ONLY if the drive letters are correct.
Private Sub Command1_Click()
Dim RetVal
RetVal = Shell("C:\Program Files\Adobe\Reader 9.0\Reader\acrord32 I:\brochure.pdf")
End Sub
If the drive letters are not right, it obviously wont work, hence the problem.
Thanx.
Hi there
If you're using new version of VB you can type the following
Process.Start("c:\mypdffile.pdf")
More easy then that just if you double click over the file...
I know that your project isn't being worked on any more. But the script to get the drive letter in VB looks like this: -
Public Function OpticalDrive()
-
Dim CDRom As String = ""
-
-
For Each drive_info As DriveInfo In DriveInfo.GetDrives()
-
If (drive_info.DriveType() = DriveType.CDRom) Then
-
If (drive_info.IsReady = True) Then
-
CDRom = drive_info.Name
-
End If
-
End If
-
Next drive_info
-
-
Return CDRom
-
End Function
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: yanivmad |
last post by:
hi
I like to ask if there any option to control the html files?!?
I have some HTML files at my web site that use
one "Help.htm" file for all the pages {I use the
"window.open(.... " option at JS },
and I like to open only one file every time for all the files.
I use "myFunc.js" javascript file for all the files that try to open the...
|
by: Charles F McDevitt |
last post by:
I'm trying to upgrade some old code that used old iostreams.
At one place in the code, I have a path/filename in a wchar_t string
(unicode utf-16).
I need to open an ifstream to that file. But the open() on ifstream only
takes char * strings (mbcs?).
In old iostreams, I could _wopen() the file, get the filedesc, and call
attach() on...
|
by: Dino Buljubasic |
last post by:
My application creates some temporary files that are deleted when my
application terminates.
However, if a temp file is open, it will not be deleted and
application will crash.
How can I check if a file is open before deleting it
Something like this
|
by: Mattbooty |
last post by:
Hello,
Not sure if anyone else has seen this bug, but I have a form where
the entire form is covered with a picturebox. The picturebox has a
mouseup event. I also have an open file dialog for loading images into
the picturebox. If you double click the file you want to open in the
open file dialog, it somehow interperets one of the clicks...
|
by: qysbc |
last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is
to have the server code open a binary stream, set the content type to
"image/tiff" and call Response.BinaryWrite. On the client machine, the file
type TIFF is associated with Kodak Imaging Preview. This app works on most
client machines. When you click on the link,...
| |
by: OutdoorGuy |
last post by:
Greetings,
I have a "newbie" question in relation to opening files from C#. I have
a Windows form where I allow the user to type in a file extension in a
text box (e.g., "xls"). I then take that extension and use that as my
filter criteria for the File Open dialog.
Once the user selects a file with that extension (from the File Open...
|
by: Moumen VB.NET 2003/2005 Developer |
last post by:
How can I detect if a file sitting on a network drive is still open by another
application?
This application resides on another machine on the network?
I am using VB.NET 2003
Your help is highly appreciated
|
by: Ryan Liu |
last post by:
Hi,
Both way works, I'd just ask some experts which way is better?
My application creates a log file daily.
Now each time when I write a log, I will open the file and append to the
end. Ocz, if the file is not exist(e.g. another day), it will creates the
file first.
|
by: Ros |
last post by:
There are 10 files in the folder. I wish to process all the files one
by one. But if the files are open or some processing is going on them
then I do not want to disturb that process. In that case I would
ignore processing that particular file and move to next file.
How can I check whether the file is open or not?
I tried os.stat and...
|
by: Ofelia |
last post by:
Hi,
I'm new to this forum and to Perl language but I would like to ask for your help.
I'm working in Linux and the files I need to process are in the format “file.gz”.
I created a script which should decompress, open and then delete nearly 400 files. To do so I use "open FILEPT, "zcat $filename|"".
In the beginning the script works fine, but...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |