Open PDF Through Visual Basic Only Works When Acrobat Prof 8.0 Instance Is Open
Hi all,
Something strange happens to my code (it used to work correctly in the past).
When executing next sample code:
Code:Dim ac_App As Object Dim ac_AVDoc As Object
Set ac_App = CreateObject("AcroExch.App") Set ac_AVDoc = CreateObject("AcroExch.AVDoc")
ac_AVDoc.Open "c: emp.pdf", "Test"
I get error message:
Quote:Run-time error '-2147024875 (80070015)' Automation error
When Acrobat Pro 8 is running everything works fine.
With some sloppy programming I resolved my problem (see code below), but this doesn't seem right to me. Does anyone know what the reason could be for this?
Code:Dim ac_App As Object Dim ac_AVDoc As Object
Shell "C:Program FilesAdobeAcrobat 8.0AcrobatAcrobat.exe", vbHide
Set ac_App = CreateObject("AcroExch.App") Set ac_AVDoc = CreateObject("AcroExch.AVDoc")
ac_AVDoc.Open "c: emp.pdf", "Test"
I've allready checked my register and AcroExch.App, .PDDoc, .AVDoc, etc.. are registrated. Although, I noticed that there is also an instance of AcroExch.App.1 etc. registrated. Could this be the issue? (see screen capture of registry in att.)
Hope anyone can help me, 'cause it's getting messy here at the moment !
Thanks in advance.
DoLp
Edited by - DoLoop on 5/30/2008 9:20:54 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Error Late-binding Creating Acrobat &"AcroExch.PDDoc&" (registrated Acrobat Prof 8.0)
Hi all,
Something strange happens to my code (it used to work correctly in the past).
When executing next sample code (with late-binding)
Code:
Dim ac_App As Object
Dim ac_PDDoc As Object
Set ac_App = CreateObject("AcroExch.App")
Set ac_PDDoc = CreateObject("AcroExch.PDDoc")
ac_PDDoc.Open "c: emp.pdf"
I get error message:
Quote:
Run-time error '-2147024875 (80070015)'
Automation error
When an instance of Acrobat Pro 8 is running, I can create with late-binding the "AcroExch.AVDoc" and "AcroExch.App". But no PDDoc.
I've looked in the registry, and this looks like the attachment.
Can anyone please help me. It's driving me nuts!
Thanks in advance!
DoLo p
Open Url Visual Basic
Hello
I would like to open an url with properties in pure visual basic code.
I know how to do that with vbscipt:
------------------
Dim url
url = "www.toto.com"
Dim hWindow
hWindow = window.open(url, "ident","scrollbars=no,resizable=yes,toolbar=no,directories=no,locatio n=no,status=no,menubar=no,left=10,top=10,width=300,height=300" )
-----------------
The function window.open isnt recognize in vb.
How can i translate it into vb ???
I know that we can do something like this:
-----------------
Dim rep
Dim url As String
url = "www.caramail.com"
rep = ShellExecute(hwnd, "open", url, vbNullString, vbNullString, 0)
----------------
Open GL In Visual Basic
hey
i just started getting into trying to use open gl and i cant find how to declare the open gl functions, i have added them to my project lib' but i just dont know how to declare them/make them work, if anyone has a link to some good tutorial or can point me in the direction of how to do this it would be great.
thanks
lee
Open GL In Visual Basic
Actually I have an Active X control of open GL provided by Waite Superbible of Open GL.
After registering the control with VB 6.0, i have written some code in visual basic using this Active x control. Although program is not giving any error during run time but it is also not carrying out any code that i have written. i don't now what is the problem. Please help me, it' is urgent.
How To Open PDF File From Visual Basic
Please Help me to solve the problem.
I want to Read data from PDF file to Visual Basic Form and I want to send some informaiton to PDF file. What will be the code for it.
Open Programs In Visual Basic
Is there a way to open up programs from VB. I wish to Open up Nero Showtime in Visual Basic. How could I do this. Also, Is there a way to restore programs already in the windwos task bar.
Thanks
Open .pdf File From Visual Basic
How can i have my program open a .pdf file? The user should already have Adobe Acrobat Reader installed on their machines...
Also, are there any free (or reallly cheap) pluggins to allow my program to open a .pdf file without having to open the external program?
thank you again for your hlep
squirrelly1
Open Powerpoint In Visual Basic
Hi there,
does someone know how to open powerpoint on no matter what microsoft operating system, or where powerpoint is installed?
There has to be a link in a registry somewhere? Isn't there a registry?
Would be very grateful for some help!
Thx
Charly
Can I Open An .exe Program With Visual Basic 6....
I'm real green to this developement stuff, but my question is, is it possible to open an .exe program with Visual basic or some other application so I can use it as an example for the application I'm creating. Or if I lost all my project files how would I be able to open my .exe application for futher developement, thanks
birdman
How To Open Screensaver Using Visual Basic
hi sir,
im the one of all your subscribers. i send this email because i want to know how open screensaver using visual basic. Your sites is very good to all beginner's to know the new codes of other program languange. i hope you will help about my problem.
odelonCode:how to shutdown computerCode:how to open screen saver using visual basic
How To Open Autocad 2002 With Visual Basic 6.0
I use the below code given by the Autocad 2002 Help Developer documentation but it does not work. Beside that, do i need to open something else, press which icon or any other ways for it to work? My project requires me to use only this way to continue my project. For addition coding, please tell me which line to add. Thanks!
Sub Ch2_ConnectToAcad()
Dim acadApp As AcadApplication
Dim acadDoc as AcadDocument
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
MsgBox "Now running " + acadApp.Name + _
" version " + acadApp.Version
End Sub
How To Open A File From Withing Visual Basic
Hi,
One of the tables in my SQL database has a field that holds file paths. My Visual Basic application is supposed to open these files with the click of a button (easier said than done). Instead of using a Web or OLE control, I would like to open the file in a separate window; for example, when selecting the file "Test.doc", and clicking the button, Microsoft Word is supposed to pop up displaying that file. The "Shell" function does that, but looks like I first have to figure out what type of application the file belongs to (by its extension), before I can call it, since it can only open executable files.
I was wondering if there is another function out there that would do the whole job for me (I know... I am so lazy, but my application is getting so complex that I would like to make the most out of any reusable code out there).
Thanks,
TM
Open Autocad 2007 From Visual Basic
Hi. I have the following code:
Dim objAcadApp As AcadApplication
On Error Resume Next
Set objAcadApp = GetObject(, "AutoCAD.Application")
Set objAcadApp = CreateObject("AutoCAD.Application")
objAcadApp.Visible = True
objAcadApp.Documents.Open txtFileToCheck.Text
the problem is that the AutoCad application is lunched in task manager but the file from txtFileToCheck.Text will not open. This code sequence works fine with AutoCad 2002. Could someone help me? Thank you!
Visual Basic 6 0 - Tracking Of Open Forms
Can someone please tell me how to check what forms are open/active during the run-time of a exe. Is there a event or something that allows you to query what forms are open at any given time?
Please and Thx
-Kris
Trying To Use Visual Basic 6 To Open A Microsoft Access .mdb
I have no idea where to start, I just need a general idea if this is
possible:
Originally I created a vb app that uses the WebBrowser component to
view excel files, which seemed to work fine, but does not give me the
control over the user scrolling around the spreadsheet once it was
loaded.
I then tried using the OLE object to open an embedded excel form and
that looks terribly ugly when you try to edit any of the fields.
So now I'm on to trying to open an access application within my vb
application. Is this even possible? and if so what component do I
need to import inorder to open the *.mdb file? I've searched and
searched but to no avail it looks like no one has tried doing this
(perhaps there are better ways).
Please help, I'm running out of time... Thanks in advance,
Perry
How To Open An Excelsheet From Visual Basic Temporarily
Hi Forum
I am working with Visual basic along with Excel
The application i am working on is I want to take the data from an MSHFLexGrid in Visual Basic and put it into an Excel Sheet and it should open automatically then later when the user sees the sheet he may decide whether to save it or print what ever.
Now how to open an anonymous worksheet which is not existing.
Sridhar
Outlook Visual Basic Editor Won't Open
Hey guys,
Wierd problem. I'm trying to open my outlook visual basic editor. I go to tools, macros, and visual basic editor. The problem is, when I click on it,, nothing happens. The editor refuses to pop up. The same thing happens when I try to click on my security settings. Nothing happens. Seemingly everything else is working fine, but the macro, and security sections for some reason are not working. I was thinking a registry key might have been corrupted or something like that??? I'm at a loss. Can anyone help?? Thanks!
How To Open Excel Spreadsheet In Visual Basic
I want to use Excel Spreadsheet as a datafile and read the data in Visual Basic. How do I do that? In other words, I want to read a Excel file in Visual Basic and retrieve the data from the file. Should I use the Excel control? Thanks in advance
Visual Basic Excel -> Open Drive And List Box
i'm using Excel Visual Basic(MaCRO) to open up the data file and chart on its own.
But due to the souce code i hav create, i can only view the folder name that i have display.
Public Function fishing() As String
Dim File2 As String
Dim q, y, Combobox1_Count As Integer
'Remove any item from combobox2
While Sheet1.Combobox2.ListCount > 0
Sheet1.Combobox2.RemoveItem 0
Wend
'Extract FileName from text file
Set fs = Application.FileSearch
With fs
.LookIn = "C:"
.Filename = "*.*"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
'MsgBox "There were " & .FoundFiles.Count & _
' " file(s) found."
For i = 1 To .FoundFiles.Count
Sheet1.Combobox2.AddItem .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
End Function
I will need to change the souce code every time if i hav display in different folder.
I found out that i need to use the dirlistbox and Drivelistbox but this two buttons is not in the excel.
so can anyone tell me what kind of control or souce code i can use without use this two control button?
Embedded Visual Basic File Open Problem
In evb 2002 for Windows CE
Code:
Dim File As String
MkDir ("Argonaut Data")
File = "Argonaut DataData.txt"
Open File For Append As #1
Print #1, strTemp
Close #1
When make file, VB will give out error saying "Compile Error: Expected End of Statement" for the Open command line
Now what is that suppose to mean?
How To Open PDF Files Via Visual Basic Macro Code ?
How can I code a Macro in Excel to search in a preset directory and pull out, aka open/run
a certain Adobe Acrobat .pdf file automatically?
Is this even possible to code in Excel Macro or is it out of its scope of what Excel VB code can do?
Right now I have a very repetitive task where depending on the value of a certain field in Excel I have to search for the right/corresponding .pdf file and open it up do work in the .pdf as well as the Excel worksheet... I have to do like hundreds of this....
So is there a quick way to code in Excel that a certain value will open a certain file named .pdf acrobat file? Can other programs/files be called upon and ran/started/opened from within Excel Macro?
Thanks
How To Open A Batch File I've Created With Visual Basic 6?
Hey, I am creating a Visual Basic mini program that detects the day of the week and if it is Wednesday it will run a batch file which starts a system scan with my anti-virus and afterwards it will shutdown. If the day is not Wednesday it will run another batch file which will shut down the computer, skipping the scan.
So, is there anyway to open a program with Visual Basic? Thanks.
Open File Dialog In Excel Through Visual Basic
Hello... I'm trying to find the code to do the following.
public sub
Dim strMyFile as String
strMyFile = (file opener dialog)
(rest of code)
end sub
But I'm having trouble finding the appropriate dialog menu command... can you point me in the right direction?
Finding Text In Open Files Using Visual Basic
Hi all, I hope someone can help me with this.
Basically, I have two text files (which I will call for arguments sake file1 and file2). File1 contains a long list of registry keys extracted using regedit and file2 contains a similar set of keys, also extracted using regedit but from a different machine.
What I need to be able to do is compare the two data files to see what keys are different between the two machines. At present I read in the two data files and write them to a database, but this is extremely slow and indeed crashes when trying to compare two HKLM subsets(which is not surprising really). I have come up with an idea of reading in the first file and each time it comes to a new key checking to see if it exists in the second file, i.e
Read in Key 1
Does it exist in File 2?
If no, then write error log
Otherwise continue
Read in Key 2
etc, etc.
What I need to know is if there is any way of finding a particular text string in an open file. At present I am using the standard VB Filehandling functions, (open "filename.txt" for output as #1 etc), but if there is a better way then I would appreciate it.
Any help or advice would be useful.
Thanks
Andrew
Open An Existing .ppt Powerpoint File From Visual Basic 6
I'm creating a program in Visual Basic 6 to export pictures from existing powerpoint file.
How do I open an existing powerpoint file through a common dialog control. Powerpoint application should not open, basically I just want to open a ppt file leave it in
"memory" and then export the pictures? All this in VB6 and not VBA!
I know I can use the GetObject method but I just don't know how to use this. I have done research but nothing helps!
Hope you guys can help me out!
If you don't understand please ask questions!
Thanks
Regards
Open Word Document With Macro Disabled From Visual Basic
Hi,
I have another problem. I need to open word documents from a program in Visual Basic in order to parse them but some of these documents have macros in their open method and i don't want to run them when i poen the documents. How can I do this? Is there a property in the word.application object?
Thanks
Xtian
Open Password Protected Excel Workbook In Visual Basic
Hello,
My VB 6.0 application read and writes data from and to a MS Excel workbook,
using the Microsoft.Jet.OLEDB.4.0 provider.
Now I want to protect the Excel workbook with a password, but I figured out
that it is not possible to open the workbook for data access with ADO
(http://support.microsoft.com/?KBID=211378).
Is there another way to use a password protected Excel workbook in my
application?
Regards,
Geert-Pieter
How To Open A Folder Path In The Common Dialog Box In Visual Basic 6
I'm trying to open a path of a folder in the common dialog box. and it wants me to open a file instead?
here is my code when I click on the button it wants me to open a file first then i click on a text file..which i don't want it..
for example I want my Result to be: C: emp estpath ==> now it gave me C: emp estpath after I select
a file in the testpath folder and I don't want () at the end of (testpath)
Code:Private Sub cmdOpenFolderPath_Click()
Dim MyPos As Integer
Dim newPathString As String
Dim origPath As String
On Error GoTo ErrorTrap ' Set the error trap
CommonDialog1.Filter = "Text Files *.txt/*.txt/All Files *.*/*.*" 'dialog box
CommonDialog1.ShowOpen ' file display pattern
Open CommonDialog1.FileName For Input As #1 ' Open a file name in the dialog box
Caption = CommonDialog1.FileName
ADSDBPath = CommonDialog1.FileName
MyPos = InStrRev(origPath, "", Len(origPath))
newADSDBString = Left(origPath, MyPos)
origPath = newPathString ' Assign a new database
lblNewPath.Caption = origPath ' Assign a selected database path
ErrorTrap:
ErrMsg
End Sub
AbbydonKrafts - Moved from Forum News to VB & WinAPI. Also added code tags.
Edited by - AbbydonKrafts on 1/11/2007 8:09:19 PM
Need Help To Open Acrobat From Vb 6
Hi all,
I've installed Adobe acrobat in my system. my application will launch Acrobat using Shell command.[vbcode]shell "C:program filesAdobeAcrobatAcrobat.exe"[/vbcode]I created a package of my application and installed on another system. In that system my application refused to open Acrobat. Since the acrobat is installed on different location. i.e., in my system it was installed in "C:program files". But In remote system it was installed in "F:program files". How can I find the location where acrobat is installed through code. So that i can run my applcation on both the systems without any problems.
Or is there any other way to get rid of this problem?
Thanks in advance.
Howto Open Cashbox Drawer Of Cash Register Using Visual Basic Code
hi,
im developing a point of sale system for the first time but i know a bit how develop database system using visual basic and mdb and i plan implement on the network and my question are:
- using visualbasic code how can i open cash register drawer?
- does cash register printer the same as the usual printer?
TIF/BMP To PDF Using Visual BASIC 6 And Acrobat 5, HELP PLEASE
I am trying to convert BMP and TIF files to PDF using VB 6.0. I have Distiller 5.0Acrobat 5.0 and the SDK installed. Also, my VB projects references "Adobe Acrobat 5.0 Type Library," "Acrobat Distiller" and "AdobePDFMakerX." The Adobe SDK documentation is of no help. Could someone please tell me why this code below does not work or at least another way of doing it. The obvious things to me no longer work. Any help would be greatly appreciated!! Thanks in advance.
Code:
Public Sub CreatePDF(sSourceBMP As String, sTargetPDF As String)
'modified, URL: http://web.ukonline.co.uk/vance/code/tif2pdf.htm
Dim AcroApp As CAcroApp
Dim AVDoc As CAcroAVDoc
Dim PDDoc As CAcroPDDoc
Dim IsSuccess As Boolean
Set AcroApp = CreateObject("AcroExch.App")
Set AVDoc = CreateObject("AcroExch.AVDoc")
Call AVDoc.Open(sSourceBMP, "Windows-BMP") ' Nothing opens???
Set AVDoc = AcroApp.GetActiveDoc
If AVDoc.IsValid Then
Set PDDoc = AVDoc.GetPDDoc
' Fill in pdf properties.
PDDoc.SetInfo "Title", "Title of PDF"
PDDoc.SetInfo "Author", "Author of PDF"
PDDoc.SetInfo "Subject", "Subject of PDF"
PDDoc.SetInfo "Keywords", "Keywords of PDF"
If PDDoc.Save(1 Or 4 Or 32, sTargetPDF) <> True Then
MsgBox "Failed to save " & sTargetPDF
End If
PDDoc.Close
End If
'Close the PDF
AVDoc.Close True
AcroApp.Exit
'Cleanup
Set PDDoc = Nothing
Set AVDoc = Nothing
Set AcroApp = Nothing
End Sub
Open Adobe Acrobat
How do I open Adobe Acrobat from with in Visual basic? I installed the Reference Adobe SVG Veiwer Type Library 2.0.
I know I can open it using the Call command and providing the location of the exe file to open acrobat reader, but the has to be a better way.
Thanks for the help
Nevin
Open Acrobat Document From VB.
I unsuscesfully try to use the Shell command to open an acrobat document. If Acrobat reader is installed in the computer, how can I do to open the document for VB?
How To Control Acrobat With Visual Basic
Hi all,
I found a way of controling Acrobat or any Adobe application using Visual Basic (VB) inside Excel. I found the trick on the Adobe developper forum and used the Software Development Kit (SDK) examples. You can find all the SDK for the Adobe products on this site;
http://partners.adobe.com/asn/developer/sdks.jsp
... now here is the source code for getting a Link using Later Binding to the Acrobat document...
Dim AcrobatLink As Object
On Error Resume Next
Set AcrobatLink = CreateObject("AcroExch.App")
It is that simple...
Take care,
-YX-
Printing To Acrobat From Visual Basic
Hi All,
I have searched all over and cannot find the code that will enable me to print from visual basic to Acrobat.
I have an rtf file already but now I need to convert that text file to a .pdf file.
Can anyone help with the code that will enable me to do this?
Thanks for your help.
Cheers,
Ryan
Can You Open/run A Non-ms Program, Such As Adobe Acrobat?
what i'd like to do is have a button on excel that launches a program such as adobe acrobat. i've searched on the help file, but have only found opening up notepad (but its a ms program) with shell.
any help would be greatly appreciated! thanks for looking!
Open Acrobat Reader Or Notepad [VB6]
I need to code the following pseudo code in VB6; any help would be appreciated.
If Acrobat Reader is installed then open c: est.pdf
Else if Notepad is installed then open c: est.txt
Otherwise Message box, no application able to load information
Thanks,
Open Acrobat Reader Or Notepad [VB6]
I need to code the following pseudo code in VB6; any help would be appreciated.
If Acrobat Reader is installed then open c: est.pdf
Else if Notepad is installed then open c: est.txt
Otherwise Message box, no application able to load information
Thanks,
|