- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
VB Script - Need help to complete this VB Sript in Customizer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-08-2011 08:01 PM
When clicing a custom button, I would like the lot number to become part of the file path location so that Adobe will launch and will pull up a file - the lot number is part of the file name.
This is what I have so far (see below) - I am doing this script button at the LotSerialNumber Inquiry page
' Use ShellExecute to open a particular file
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute( "M:\Quality Logs\Quality Logs\Master-CofA File\" & (ML_LOTSERIALNO$) &".pdf")
I would like for the actual lot number value to pass through and be part of the file path - right where I have noted (ML_LOTSERIALNO$)
Solved! Go to Solution.
Re: VB Script - Need help to complete this VB Sript in Customizer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-08-2011 08:23 PM
I have this posted somewhere around here. Not in this section but in another. It is at the office so I'll post in the morning if no one has replied.
--------------------------------------------------------------------------
You have enemies? Good. That means you've stood up for something in your life.
Re: VB Script - Need help to complete this VB Sript in Customizer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-08-2011 08:27 PM
Thanks Louie! I know that I am close with what I have now... But still No Cigar!
I will check back in the morning.
valTyp = ""
retVal = oBusObj.GetValue("ML_LOTSERIALNO$", lotno)
' Use ShellExecute to open a particular file
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute( "M:\Quality Logs\Quality Logs\Master-CofA File\" & lotno &".pdf")
Re: VB Script - Need help to complete this VB Sript in Customizer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-09-2011 06:06 AM
Here is what I use to call up a file.
Dim wsh
set wsh = CreateObject("WScript.Shell")
Set filesys = CreateObject("Scripting.FileSystemObject")
PDFPath = "L:\Products\DrawingsPDF\"
PDFFile = ML_UDF_IMH_DRAWING_LOCATION
docPath = "L:\DrawingsPDF\"
if filesys.FileExists(PDFPath & PDFFile) then
Return = wsh.Run(chr( 34) & PDFPath&PDFFile & chr(34),1,False)
else
Return = wsh.Run(chr( 34) & docPath&PDFFile & chr(34),1,False)
end if
Set wsh = NothingIn your case you can substitude what I have for PFDFile with ML_LOTSERIALNO$
--------------------------------------------------------------------------
You have enemies? Good. That means you've stood up for something in your life.
Re: VB Script - Need help to complete this VB Sript in Customizer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-09-2011 09:31 PM
Hi Louie - Please see the attached file - this is the error I get when trying what you have suggested below. Did I miss something?
I have also tried this:
objShell.ShellExecute("M:\Quality Logs\Quality Logs\Master-CofA File\" & ML_LOTSERIALNO$ & ".pdf")
And I get a similar error (below)
Script Line........ 27
Script Column...... 87
Script Text........ objShell.ShellExecute("M:
Quality Logs
Quality Logs
Master-CofA File
" & ML_LOTSERIALNO$ & ".pdf")
Any ideas of what to try next? ![]()
Re: VB Script - Need help to complete this VB Sript in Customizer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-09-2011 09:59 PM
This code works to pull the CofA (.pdf file) -
' Use ShellExecute to open a particular file
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute( "M:\Quality Logs\Quality Logs\Master-CofA File\JBPH87.pdf" )
Now if I can get the lot number portion of this code to feed in from the field ML_LOTSERIALNO$ after it returns that value to the script, that is exactly what I need it to do. Dunno why the error ![]()
Re: VB Script - Need help to complete this VB Sript in Customizer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-09-2011 10:07 PM
I GOT IT!!!!!!!!!! Had to remove the $ from the FIELDNAME
ML_LOTSERIALNO$
I used ML_LOTSERIALNO


