[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Olaf, where did you get the PDF info from?

(Mike Mitchell)

10/25/2011 10:19:00 AM

In one of your code snippets on the web you have:

Set PDFExt = Controls.Add("AcroPDF.PDF.1", "PDF") 'version 7
If PDFExt Is Nothing Then
Set PDFExt = Controls.Add("PDF.PdfCtrl.6", "PDF")
If PDFExt Is Nothing Then
Set PDFExt = Controls.Add("PDF.PdfCtrl.5", "PDF")
If PDFExt Is Nothing Then
Set PDFExt = Controls.Add("PDF.PdfCtrl.1", "PDF")
If PDFExt Is Nothing Then
DispMessage "PDF-OCX not found!" & vbCrLf & _
"Please install Acrobat Reader!"
Unload Me
Exit Sub
End If
End If
End If
End If

in order to load a PDF into a VB6 form.

Where did you find the "magic words" AcroPDF.PDF.1, PDF.PdfCtrl.6,
PDF.PdfCtrl.5 etc, and where can I find the one for using Reader 8,
Reader 9, and Reader X?

Thanks!

NB: I've tried using the above code with Reader X installed and it
loads, but neither the Acrobat Full Search or Find works. Find does
work if I load the PDF on a PC with Reader 9 installed (using the
above code).

MM
20 Answers

Atishoo

3/31/2010 4:27:00 PM

0

OK that would be similar only the other way round to the code I posted
earlier, am not sure how your triggering it but try something like this.

With Worksheets("Sheet2").Range("a:a")
Set c = .Find("", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
v=c.offset(-1,0).value
With Worksheets("sheet1").Range("a:a")
Set d = .Find("v", LookIn:=xlValues)
If Not d Is Nothing Then
firstAddress = d.Address
Do
c.offset(-1,1).value= d.offset(0,1).value
c.offset(-1,2).value= d.offset(0,2).value

Loop While d Is Nothing

End If
End With
Loop While c Is Nothing
end if
end with

Good luck
please let me know how it goes

tomjoe

4/1/2010 10:01:00 AM

0

Sorry, the code did't do the trick.

Let me be more clear in the explanation of the case.
I have adjusted the tables in sheet 1 and sheet 2 to get it more right (see
under).

In Sheet 2 it will steadily be added new Items. Now you can see that it's a
new item ,40, there (see table under). I then want the additional code to
look up when there is a new item in sheet 2 col A and the cell to the right
(col B) is NOT filled THEN go to Sheet 1 in the named range "Products" (see
table under) and get the corresponding Product an Variant thats on the same
row (as in this example the item 40) and paste these into the empty cells in
sheet 2 in the same row as 40 - in col B and C



Sheet 1
Named range A2:C5 = Products

Item ProdName Var
10 Product 1 Variant 1
20 Product 2 Variant 2
30 Product 3 Variant 1
40 Product 4 Variant 2


Sheet 2
Item ProdName Var
10 Product 1 Variant 1
20 Product 2 Variant 2
10 Product 1 Variant 1
30 Product 3 Variant 1
40


I hope this was more precicely formulated.

Thank you for not giving up on me :-)

Atishoo

4/1/2010 5:25:00 PM

0

This brings us back to the question of how your triggering your code?
Your using a user form to enter data into sheet1 column A, so i assume you
have a "submit" button or OK or apply or something like that on your user
form for the end user to click when they have entered their data.
I would be thinking that your sub to lookup corresponding data from sheet 1
and populate sheet 2 with it should follow the sub that you have on this
command button.



"tomjoe" wrote:

> Sorry, the code did't do the trick.
>
> Let me be more clear in the explanation of the case.
> I have adjusted the tables in sheet 1 and sheet 2 to get it more right (see
> under).
>
> In Sheet 2 it will steadily be added new Items. Now you can see that it's a
> new item ,40, there (see table under). I then want the additional code to
> look up when there is a new item in sheet 2 col A and the cell to the right
> (col B) is NOT filled THEN go to Sheet 1 in the named range "Products" (see
> table under) and get the corresponding Product an Variant thats on the same
> row (as in this example the item 40) and paste these into the empty cells in
> sheet 2 in the same row as 40 - in col B and C
>
>
>
> Sheet 1
> Named range A2:C5 = Products
>
> Item ProdName Var
> 10 Product 1 Variant 1
> 20 Product 2 Variant 2
> 30 Product 3 Variant 1
> 40 Product 4 Variant 2
>
>
> Sheet 2
> Item ProdName Var
> 10 Product 1 Variant 1
> 20 Product 2 Variant 2
> 10 Product 1 Variant 1
> 30 Product 3 Variant 1
> 40
>
>
> I hope this was more precicely formulated.
>
> Thank you for not giving up on me :-)

Atishoo

4/1/2010 5:39:00 PM

0

oops
my bad
remove the quotation marks from round the V
sorry

"Atishoo" wrote:

> This brings us back to the question of how your triggering your code?
> Your using a user form to enter data into sheet1 column A, so i assume you
> have a "submit" button or OK or apply or something like that on your user
> form for the end user to click when they have entered their data.
> I would be thinking that your sub to lookup corresponding data from sheet 1
> and populate sheet 2 with it should follow the sub that you have on this
> command button.
>
>
>
> "tomjoe" wrote:
>
> > Sorry, the code did't do the trick.
> >
> > Let me be more clear in the explanation of the case.
> > I have adjusted the tables in sheet 1 and sheet 2 to get it more right (see
> > under).
> >
> > In Sheet 2 it will steadily be added new Items. Now you can see that it's a
> > new item ,40, there (see table under). I then want the additional code to
> > look up when there is a new item in sheet 2 col A and the cell to the right
> > (col B) is NOT filled THEN go to Sheet 1 in the named range "Products" (see
> > table under) and get the corresponding Product an Variant thats on the same
> > row (as in this example the item 40) and paste these into the empty cells in
> > sheet 2 in the same row as 40 - in col B and C
> >
> >
> >
> > Sheet 1
> > Named range A2:C5 = Products
> >
> > Item ProdName Var
> > 10 Product 1 Variant 1
> > 20 Product 2 Variant 2
> > 30 Product 3 Variant 1
> > 40 Product 4 Variant 2
> >
> >
> > Sheet 2
> > Item ProdName Var
> > 10 Product 1 Variant 1
> > 20 Product 2 Variant 2
> > 10 Product 1 Variant 1
> > 30 Product 3 Variant 1
> > 40
> >
> >
> > I hope this was more precicely formulated.
> >
> > Thank you for not giving up on me :-)

tomjoe

4/4/2010 6:16:00 AM

0

Thank you Atishoo

Your code works just fine. It was the quotation marks round the V that
prevented the code to work as expected.



"Atishoo" wrote:

> oops
> my bad
> remove the quotation marks from round the V
> sorry
>
> "Atishoo" wrote:
>
> > This brings us back to the question of how your triggering your code?
> > Your using a user form to enter data into sheet1 column A, so i assume you
> > have a "submit" button or OK or apply or something like that on your user
> > form for the end user to click when they have entered their data.
> > I would be thinking that your sub to lookup corresponding data from sheet 1
> > and populate sheet 2 with it should follow the sub that you have on this
> > command button.
> >
> >
> >
> > "tomjoe" wrote:
> >
> > > Sorry, the code did't do the trick.
> > >
> > > Let me be more clear in the explanation of the case.
> > > I have adjusted the tables in sheet 1 and sheet 2 to get it more right (see
> > > under).
> > >
> > > In Sheet 2 it will steadily be added new Items. Now you can see that it's a
> > > new item ,40, there (see table under). I then want the additional code to
> > > look up when there is a new item in sheet 2 col A and the cell to the right
> > > (col B) is NOT filled THEN go to Sheet 1 in the named range "Products" (see
> > > table under) and get the corresponding Product an Variant thats on the same
> > > row (as in this example the item 40) and paste these into the empty cells in
> > > sheet 2 in the same row as 40 - in col B and C
> > >
> > >
> > >
> > > Sheet 1
> > > Named range A2:C5 = Products
> > >
> > > Item ProdName Var
> > > 10 Product 1 Variant 1
> > > 20 Product 2 Variant 2
> > > 30 Product 3 Variant 1
> > > 40 Product 4 Variant 2
> > >
> > >
> > > Sheet 2
> > > Item ProdName Var
> > > 10 Product 1 Variant 1
> > > 20 Product 2 Variant 2
> > > 10 Product 1 Variant 1
> > > 30 Product 3 Variant 1
> > > 40
> > >
> > >
> > > I hope this was more precicely formulated.
> > >
> > > Thank you for not giving up on me :-)

Dee Earley

10/25/2011 10:36:00 AM

0

On 25/10/2011 11:18, MM wrote:
> In one of your code snippets on the web you have:
>
<SNIP>
>
> in order to load a PDF into a VB6 form.
>
> Where did you find the "magic words" AcroPDF.PDF.1, PDF.PdfCtrl.6,
> PDF.PdfCtrl.5 etc, and where can I find the one for using Reader 8,
> Reader 9, and Reader X?

Those are the ProgIDs for each component that are used to find its
details. You can see these in the registry under HKEY_CLASSES_ROOT hive.

Note that each is version specific so using "PDF.PdfCtrl" would normally
get you the latest version.
You will need to add a reference to a given DLL/OCX, or use OLEView or
similar to determine what methods are supported.

--
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

(Mike Mitchell)

10/25/2011 10:56:00 AM

0

On Tue, 25 Oct 2011 11:36:19 +0100, Deanna Earley
<dee.earley@icode.co.uk> wrote:

>On 25/10/2011 11:18, MM wrote:
>> In one of your code snippets on the web you have:
>>
><SNIP>
>>
>> in order to load a PDF into a VB6 form.
>>
>> Where did you find the "magic words" AcroPDF.PDF.1, PDF.PdfCtrl.6,
>> PDF.PdfCtrl.5 etc, and where can I find the one for using Reader 8,
>> Reader 9, and Reader X?
>
>Those are the ProgIDs for each component that are used to find its
>details. You can see these in the registry under HKEY_CLASSES_ROOT hive.
>
>Note that each is version specific so using "PDF.PdfCtrl" would normally
>get you the latest version.
>You will need to add a reference to a given DLL/OCX, or use OLEView or
>similar to determine what methods are supported.

I've actually just discovered an AcroPDF.DLL ActiveX control that was
installed with Reader 9. Dunno yet whether it's supported unchanged on
Reader X. It's only descirbed, as far as I can tell, in the VB.Net
stuff in the Adobe SDK, but it works with VB6 too! This may be a
better approach than using Controls.Add("AcroPDF.PDF.1", "PDF") etc.

MM

DaveO

10/25/2011 3:22:00 PM

0


"MM" <kylix_is@yahoo.co.uk> wrote in message
news:g65da75g5e4vv5k0ogc0p36oehpn1fjrbt@4ax.com...
> stuff in the Adobe SDK, but it works with VB6 too! This may be a
> better approach than using Controls.Add("AcroPDF.PDF.1", "PDF") etc.

I don't see how using anything fromn Adobe could be better than anything
else. I like many others have long dumped Acrobat for the bloated crap that
it is and use an alternative PDF reader because some people insist on using
the damn format, I use Foxit reader but there are many others out there.

DaveO.


DaveO

10/25/2011 3:23:00 PM

0


"MM" <kylix_is@yahoo.co.uk> wrote in message
news:g65da75g5e4vv5k0ogc0p36oehpn1fjrbt@4ax.com...
> stuff in the Adobe SDK, but it works with VB6 too! This may be a
> better approach than using Controls.Add("AcroPDF.PDF.1", "PDF") etc.

I don't see how using anything fromn Adobe could be better than anything
else. I like many others have long dumped Acrobat for the bloated crap that
it is and use an alternative PDF reader because some people insist on using
the damn format, I use Foxit reader but there are many others out there.

DaveO.



(Mike Mitchell)

10/25/2011 3:37:00 PM

0

On Tue, 25 Oct 2011 16:22:10 +0100, "DaveO" <djo@dial.pipex.com>
wrote:

>
>"MM" <kylix_is@yahoo.co.uk> wrote in message
>news:g65da75g5e4vv5k0ogc0p36oehpn1fjrbt@4ax.com...
>> stuff in the Adobe SDK, but it works with VB6 too! This may be a
>> better approach than using Controls.Add("AcroPDF.PDF.1", "PDF") etc.
>
>I don't see how using anything fromn Adobe could be better than anything
>else. I like many others have long dumped Acrobat for the bloated crap that
>it is and use an alternative PDF reader because some people insist on using
>the damn format, I use Foxit reader but there are many others out there.

I want to embed the reader/a reader into a VB6 form. If Foxit can do
that, I'll take a look.

MM