Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


What's wrong with this code?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2107
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> What's wrong with this code?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 What's wrong with this code? - 2/18/2005 4:47:16 AM   
  cricks

 

Posts: 5
Score: 0
Joined: 2/15/2005
From:
Status: offline
I am passing a value from a aspx (using vb) to a .vbs
this is the code on the first page I am using to call the 2nd page

Response.Redirect("PrintJobDesc.vbs\\PublicJobDescPath")

Here is the receiving code

Dim Word, Doc, URL
Const wdDialogToolsSpellingAndGrammar = 828
Const wdDoNotSaveChanges = 0

URL = WScript.Arguments
Set Word = CreateObject("Word.Application")
Set Doc = Word.Documents.Open(URL)
Doc.PrintOut(False)
doc.Close
Word.Quit

the variable is not getting to the receiving page, but I have verfied that it has the correct value on the sending site. I feel like it is my syntax, but I haven't a clue what I am doing wrong.[?]
 
 
Post #: 1
 
 Re: What's wrong with this code? - 2/18/2005 6:27:20 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
try to put a MsgBox inbetween to see what is actually send to the Word Doc.

[8)]

(in reply to cricks)
 
 
Post #: 2
 
 Re: What's wrong with this code? - 2/18/2005 8:23:56 AM   
  cricks

 

Posts: 5
Score: 0
Joined: 2/15/2005
From:
Status: offline
I had this code above the URL = WScript.Arguments
MsgBox " The URL is " & objArgs.count & "."
My message box say 0
if I use
'MsgBox " The URL is " & objArgs.arguments(0) & "."
'MsgBox " The URL is " & objArgs.arguments & "."
'MsgBox " The URL is " & objArgs.arguments.unknown(0) & "."
any of these I get an error message
I have also tried sending the variable in several different ways
Response.Redirect("PrintJobDesc.vbs?\\PublicJobDescPath")
Response.Redirect("PrintJobDesc.vbs?PublicJobDescPath")

thank you for suggestions..

(in reply to cricks)
 
 
Post #: 3
 
 Re: What's wrong with this code? - 2/18/2005 9:28:28 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
I've never try to send an argument to vbs file within an ASP, but perhaps you can try
Response.Redirect("PrintJobDesc.vbs PublicJobDescPath").

Also, your objArgs object was declared, it was URL (if it's what I think it is). You can use the following to see how many arguments are passed to the script.

msgbox WScript.Arguments.Count

(in reply to cricks)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> What's wrong with this code? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts