Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Vbscript To Refresh Current Page?

Hi, I need help please!
I need a script to refresh the current page.
Reason being is that i had jscript tooltip in an xslt file that works fine when first time the page is loaded but once onpostback - it does not work.
So i can't edit the aspx file becuase the entire site uses the file.
So i would like to Refresh the Current ASPX/Page so that it at leats works the first time user opens page!

strStUOM = "aObjects("FG1030StUOM")"
If strStUOM = "Liter" Then

End If
This gives me an error: Object required: 'window'

Please Assist!

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Vbscript To Refresh Current Page
Hi, I need help please!
I need a script to refresh the current page.
Reason being is that i had jscript tooltip in an xslt file that works fine when first time the page is loaded but once onpostback - it does not work.
So i can't edit the aspx file becuase the entire site uses the file.
So i would like to Refresh the Current ASPX/Page so that it at leats works the first time user opens page!
Please Assist!

Can I Pass A Parameter To VBSCript And How Can I Get Current Path In VBScript?
Can I pass a parameter to VBSCript ?
How can I get the local path in VBScript?

Retreiving The Values Of Controls Of Previous Page On Current Page In
i am working on webform2 having radiobutton1 which has been redirected from webform1 also having radiobutton1

how do i access webform1's radiobutton1.value ?

Kindly help



I Need To Extract The Page Number From The Current Page In Word
I need to extract the page number from the current page in word and put it in to the variable pgNum


Getting Current Date In VBScript
How do I correctly check the current date against a preset date in the future and based on that call this function EarlyPrice or the other function RegPrice?

Here is what I have:

Dim MyDate
Mydate = Date ' will return system date
If MyDate <= ' the rest is a clue to me!

Refresh Network Folder - VBScript
I am cross-posting this. Hopefully someone can help. I use VBScript in
SQL Server DTS to copy an Excel file from a intranet location to a
network share. I then check for the file, and if present, I import the
file. The reason for the check, is that the file will not alway be
present. When I run the steps individually, everything works grand.
When running the package in sequence, it ALWAYS fails. Says the file
does not exist. The one exception to this, is if I have some sort of
message box within the second script. I initially figured it was a
timing issue, so I added a For..Next Loop to create a delay. No Go. My
next try (hope) is to force a refresh of the folder before cecking to
see if the file is present.

Any ideas? I use a VB 6.0 application to do the actual copying of the

- Thank You

Kevin Albrecht
Senior Treasury Analyst
Asset Liability Management
Washington Mutual Bank FA
206.302.4220 - Direct

Unable To Get Current Dir On Win98 (VBScript / JScript)
I have got a VBScript and MS JScript program and am trying to find out the current directory.


Set objFSO = CreateObject("Scripting.FileSystemObject")

That code works on WinXP but returns undefined when tried on Win98.

Does anyone know a way of getting this that works with Win98?

Listview: Refresh The Current Sort?
Hi. I've got a listview that is ordered, and user can click on column headers to re-sort by column values.

User adds more items to listview, but they always appear dead-last in the listview.

When adding a new listitem, I'd like the listview to re-sort on whatever the user previously selected.

I've tried the following logic to no avail:

Wscript.Shell | VBScript :: Set Current Working Directory
Ok, been working on a vbscript what uses to launch an application on th e client's machine but I've run into a problem.
The application reads from a child directory where the application is located in. When you launch the script via wscript it isn't running the application from where the application exists, but from the %system% directory.
I know that in VB you can call an api to set the current working directory to get around this, but I'm unable to find any such method to do so in VBScript. Tell me I'm missing something simple.
I'm also trying to find out if you can set an argument at runtime for this application that sets the path to run from, but I don't know if this is possible.
Got a solution?

VBscript And Ado To A Html Page..
Ok im not sure if html topics are allowed here but its also a vb question..

Im not speaking of ASP page but a plain html page that display a record from my access db..Im ecountering some error, like Activex connot create object (ADODB.COnnenction), in asp i reference the ADO(msado15.dll) through the GLOBAL.ASA <metadata>, but global.asa is only for ASP pages, im only working on a HTML page that display a record from a ACCESS DB through vbscript(ado)..So how can i do that experts?Any sample codes of referencing the ADO from a html page through VBscript??

Im begging help me here....

Execute Vbscript From Web Page
i need to be able to run a script from within vb.

i can load the page sucessfully and parse the tags and such on the form but dont know how to run a script.

basically what i have to do is simulate the user clicking on one of the javasacript menu items.

Dim In A Loop - VBScript For ASP Page
Is it possible to make dim statements in a loop and concatenate a variable name? I tried the following but it does not work.

arrCC() = objRS.getRows()

intFirstRec = Lbound(arrCC,2)
intLastRec = Ubound(arrCC,2)

for intCount = intFirstRec to intLastRec
    strCCName = arrCC(1,intCount)
    'dim various accumulators needed
    dim "dblJob" & strCCName & "Hours"
    dim "dblTot" & strCCName & "Hours"
    dim "dblAdmin" & strCCName & "Hours"

next intCount

VbScript Vs JavaScript In ASP Page
can i use both VBscript and javaScript in an ASP page? vbScript is run at server which deal with database and javaScript is run on client(browser)???

thanks in advance for the helps...

shvonne ^o^

Page Refresh
Hi everyone.

I have some code, for making a Combo become toggle between visible and not visible when an option button is selected.

Here it is.

Private Sub CommandButton22_Click()

If Slide4.OptionButton22 = False Then
Slide4.OptionButton22 = True
Slide4.ComboBox2.Visible = True
Slide4.OptionButton22 = False
Slide4.ComboBox2.Visible = False
End If
End Sub
The code works great. My problem is, when i'm in the presentation, I select the option button, the combobox appears, but I cannot make a selection on the drop down list. When I click on the combobox, the next slide appears. I think I need to refresh the page after the combobox becomes visible, but I don't know how.

Please Help.

Refresh IE Page
I want to use a method to refresh a Internet Explorer webpage, I need to just refresh the page without loading a new child of IE is there away to get the windows handle and refresh the current page using VB6?

Is There A Way To Refresh One ASP.NET Page From Another?
Assuming both ASP.NET pages are part of the same application, is it possible to refresh one of the pages when a button on the other is clicked? If so, how?

How Do I Refresh A Page?
I'm working on a program that has a catalogue and a basket that users can fill up. I have one form that displays all items in the basket. The user can click on a certain item, then on remove to take an item ut of the basket. I would like to refresh the page so that after clicking on 'remove', the list of items in the basket is automatically updated. I tried using Me.Refresh, but this doesn't work. Is there something else I can do?

Here's what I've done:

Private Sub cmdRemoveItem_Click()

x = lbItemNum(Index)
eraseItem x

End Sub

Private Sub eraseItem(ByVal itemNum As Long)
Dim i As Long
For i = itemNum To UBound(cart) - 1
cart(i) = cart(i + 1)
ReDim Preserve cart(UBound(cart) - 1)

z% = UBound(cart)
End Sub

This is the code that fills in the labels :

Private Sub Form_Load()
tot = 0 'remet tot à 0 à chaque affichage de la page au cas ou erase à été appelé

' doit faire gestion de pages (+ que 10 articles)
If Not z% = 0 Then 'voir panier vide

For y% = 0 To (z% - 1)

lbNum(y%).Caption = y% + 1
lbItemNum(y%).Caption = Str$(cart(y%).itemNum)
lbItemName(y%).Caption = cart(y%).ItemName
lbPrice(y%).Caption = CStr("$ " & cart(y%).Price)
lbColor(y%).Caption = cart(y%).Color
lbSize(y%).Caption = cart(y%).Size
lbQty(y%).Caption = cart(y%).Nbr
lbItemTot(y%).Caption = CStr("$ " & cart(y%).ItemTot)

tot = tot + cart(y%).ItemTot

Next y%

lbSubTot = CStr("$" & tot)

End If
End Sub

VBScript In Data Access Page
How do I use CreateObject in VBScript.

I have an Access db that has forms smothered with VBA. The main action that a command button carries out is reading in outlook inbox mail items into fields in a table.

The database and VBA works fine.. but I have since discovered data access pages (htm's) and the fact that i dont need to have access open to use these files.. (ie run the database entirely from a webpage).

So I thought i would ditch my forms and use webpages. This meant taking all of VBA codes and moving them over to work in VBScript.

On the first few drop down combo boxes I was thinking this was going to be easy. not the case...

What follows is my importing emails command.. originally from VBA.. now in vbscript.. How do i get this working?

<SCRIPT language=vbscript event=onclick for=ImportEmail>
Dim TempRst 'As Recordset
Dim OlApp 'As Outlook.Application
Dim Inbox 'As Outlook.MAPIFolder
Dim MoveToHere 'As Outlook.MAPIFolder
Dim InboxItems 'As Outlook.Items
Dim Mailobject 'As Object
Dim objReply 'As String
Dim objRecip 'As String
Dim straddress '
Dim objAttach 'As Outlook.Attachment
Dim j 'As Integer
Set OlApp = CreateObject("Outlook.Application")
Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
Set MoveToHere = OlApp.GetNamespace("Mapi").GetDefaultFolder(3)
Set TempRst = CurrentDb.OpenRecordset("Emails")
Set InboxItems = Inbox.Items
DoCmd.Hourglass True
j = 0
For Each Mailobject In InboxItems
With TempRst
On Error Resume Next
[ReceiveDate] = Mailobject.SentOn
.... etc etc etc...

Basically the code doesnt get too far.. gives me an error message on the createobject.. can you create objects in vbscript? is what im doing not able to be done?

Run Access Query From ASP Page (VBScript)
Hi wondered if anyone could help. Running the code below, but I am getting the error at bottom of msg when I run the page (code below). Although, when I run the task manager MSAccess.exe is running.


VB Code:
strDbName = "Dates.mdb"Dim objAccessset objAccess = Server.CreateObject("Access.Application")objAccess.Visible = FalseobjAccess.OpenCurrentDatabase Server.MapPath(strDbName), True ' **objAccess.DoCmd.RunMacro "myTestMacro"objAccess.CloseCurrentDatabaseSet objAccess = Nothing

** this is the line that generates the error below

Error Type:
/testwebsite/macro.asp, line 8

I have checked the path to the DB it's correct and I have all my browser security settings to enable Activex's etc...

Access 2000, WinXP, IIS, ASP (VBscript)



Accessing Variables In Vbscript On Asp Page
Hi all,

Hopefully someone can help. I'm stuck on this problem.

I have a vb file, which calls an asp page and passes variables in the query string.

The asp page assigned the variables like so:


sTabNum = "" & request.querystring("CurTabNum")
sCallback="" & Request.QueryString("Callback")
pMode = request.querystring("pMode")


A stored procedure is executed, which takes some of these variables as parameters, and this works fine.

But I have a bit of vbscript that looks like this, that returns back to the other file if all is well:


if len(sCallback) > 0 then
<script language="vbscript">
end if

Inside this vbscript code, my variables sCallback and pMode are apparently not accessible. When I try to output them, they are blank, and the code doesn't return to the proper location because of this.

Why aren't they accessible? Ideas for how to get around this?

Any help is much appreciated!

Did Any 1 Worked With WMI_printer And Vbscript In Asp Page?
what i want it to do :
is to know how many pages are being prined and to know when the print has started and when has finished!
thanks in advance

Is It Possible To Refresh A IE Web Page Without Any Prompts?
As per the question.

I have a VB program that launches a IE Web Browser and when you enter the username and password it attempts to log on. If the site times out, I can detect this and issue a IE.REFRESH command, but because I posted data, a box pops up asking doing I want to re-submit the data.

Is it possible to supress this box, so no message comes up and everything gets re-submitted invisible?



Refresh Part Of A Page

i am trying to refresh only part of an asp page
can i do it?
if can how can, how?

Forcing Page Refresh From VB
I have several pages that I use at work that could really benefit from an auto refresh.  Unforntunately, the powers that be have decided that it is not in their best interest to just reprogram the page, they think the massive influx of traffic may crash the servers.  Officially, IT tells me this can't be done, but I have a feeling that it can.  Now I have used VB in the past, and I am familiar with it, but it has been a long time since I have really dug into it.  The question is, can I run a VB program to look for the title of the web page window and force it to refresh at a given interval?

Getting The Current Open Page
I have managed to create a new toolbar item in internet explorer, and i wish to have it so that when you click it, the vb program loads and gets the webpage from which ie currently has loaded? is there anyway this can be done from the vb app?

Web Browser Current Page
when i was creating a web browser for my college assignment i found a tutorial on this site to help and when i put in the code for the history it worked but it also showed the current page on the title bar (which i wanted it to do), but when you change to a different site it just added the next site address to the title bar.

heres the code:

VB Code:
Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)    On Error Resume Next    Dim i As Integer    Dim bFound As Boolean    Me.Caption = WebBrowser1.LocationName    For i = 0 To Combo1.ListCount - 1        If Combo1.List(i) = WebBrowser1.LocationURL Then            bFound = True            Exit For        End If    Next i    mbDontNavigateNow = True    If bFound Then        Combo1.RemoveItem i    End If    Combo1.AddItem WebBrowser1.LocationURL, 0    Combo1.ListIndex = 0    mbDontNavigateNow = FalseEnd Sub

many thanks for the help

Get Web Address Of Current Page
How can I get the main web address of the current page . I will be using IE 5 and I need this information for my VB program.

How Can I Get/set The Current Margins Of A Page?
Hi everybody,
I have somp problems handling new page jumps with the printer object.
I mean, I know how to get the paper size, and I know how to keep track of the lines I am printing, but the page jump is always too late, because the actual print area is smallet than the true paper size.
Can anybody tell me how to get or set the printable area of a page?

Current Page Number
Hi all,

I wrote a VB script that iterates over all tables in a Word document. My problem is that want to write out the current page number (that means the page number where the table was found) in a file.
But how do I get the current page number?
Is there a function of a table object that returns the current page number?
I tried to find something in the VB help but withoau success.

Can some help me?

Invalid Page Fault In VBScript.dll On Win98
My "Toolkit.exe" application works well on NT/2000/XP. The only known Win98 user so far has reported the following error:

Toolkit.exe has caused an invalid page fault in module VBScript.dll

The VBScript.dll version installed by InnoSetup is 5.6.

Anyone have a similar experience?

Thank you.

Error-Handling And Page Refresh. How?
Good day.
I just wanna ask what is the code for refreshing a form?
Let's say I have a list box where all the files are listed there and I choose one file and delete it and a msg box appeared that the file is deleted (and the file is really deleted). After clicking the 'Ok' in the msgbox, i want the form to refresh or i want the list box to refresh that the deleted file won't be displayed anymore. What is the code for that form reload or refresh?


How do you handle error in the drive list box if you choose drive a: and there is no diskette in drive a:
What is the code for that?

Thank you.

Force Browser To Refresh Page
How can I Force the Default Browser to refresh it's current page ?

Thks ,

Capturing The Current Internet Page?
Is there a way of capturing the current page being looked at on my pc in internet explorer and getting all the text from it?

Getting Current Page Number... A Solution
Hi all,

Here is a solution to getting the current page number in a Word document using Visual Basic. Please help other as much as you can.

The trick is to insert a new Field having a page code that gets the current page, get its value and then delete it and hope that it will not scrap the text formating. Here is code...

Public Sub Extraction()

' Basic line for application stability
On Error Resume Next

'This disable the screen update
Application.ScreenUpdating = False

'This adds the field that will give you the current page
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="PAGE * Arabic ", PreserveFormatting:=True

'This use the GoTo method to select the Field just inserted
Selection.GoTo What:=wdGoToField, Which:=wdGoToPrevious, Count:=1, Name:= _

'This output the value of it... the current page number
MsgBox (Selection.Words(1))

'This erase the inserted Field

'This enable the screen update
Application.ScreenUpdating = True

End Sub



DataReport And Printing Current Page Only

I wrote a program to track equipment transfers from one account to another. It also saves them in an Access database, so I can an electronic record of them.

Once the user completes the form, they click on the Print button, which brings up the DataReport. Unfortunately, it shows all the records. So, the user has to navigate to the end, to their report, to print it.

How can I code it so that the DataReport will only show the current record on the program?

Thank you in advance!

How Can I Get The Current Ie Home Page In Text1?
How can I get the current "IE" home page to read out in text1 .

Change The Current Home Page In PWS ?
I installed PWS to active IIS
but the PWS select a home page by default
how can i change it ?


Fax Current Page Using An ASP Button Event.
I have an ASP.NET web application with VB.NET as the code behind. We are using XP Pro as the client and and Windows 2000 Small Business Server with Shared Fax Service on. We have an event that brings up a preview confirmation page before we fax it to the client. When we are satisfied with the preview page I want them to be able to hit a button on the bottom of the .aspx page that then fires of an event to fax the this page to the client. I have tried using the FAXCOMXlib but the server seems to repond with the following error "The fax server API version does not support the requested operation." Below is a small piece of information that I am testing with, which I am borrowing from someone in the vbcity forum, this is it:

Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
        Dim objFaxOutgoingQueue As FAXCOMEXLib.FaxOutgoingQueue
        Dim g_objFaxServer As FAXCOMEXLib.FaxServer

        Dim objSender As FAXCOMEXLib.FaxSender
        Dim JobID As Object
        'intTemp = 0
        Dim schTime As Object

        'Error handling
        'On Error GoTo Error_Handler

        'Initialize the FaxServer object.
        g_objFaxServer = New FAXCOMEXLib.FaxServer

        'Connect to the fax server

        'Set the fax body
        objFaxDocument.Body = "c:simple.txt"

        'Name the document
        objFaxDocument.DocumentName = "Test Fax"

        'Set the fax priority
        objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH

        'Add the recipient with the fax number 12225550100
        objFaxDocument.Recipients.Add("3341013", "LevelOne")

        'Choose to attach the fax to the fax receipt
        objFaxDocument.AttachFaxToReceipt = True

        'Set the cover page type and the path to the cover page
        objFaxDocument.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptSERVER

        'objFaxDocument.CoverPageType = fcptSERVER
        objFaxDocument.CoverPage = "generic"

        objFaxDocument.Subject = "Today's fax"

        'Submit the document to the connected fax server
        'and get back the job ID.

        JobID = objFaxDocument.ConnectedSubmit(g_objFaxServer)

        objFaxDocument = Nothing
        objFaxOutgoingQueue = Nothing

Main question is, is there a way to fire of an event that will cause the shared fax client to start then fill the to: box in the dialog with the fax number of the client automatically. Help!!!!

Writing Contents Of HTML Page Elements (VBScript)
Someone help me.

My problem is I need to create a MSWord document and format it (2.75" down from the top of the page, centered, bembo font (don't ask)).

I can create, open, write-to, and save the document with no problem via the following code:

<script language="vbscript">
function createDocument()

Dim objWordObject
Dim objDocObject
Dim msWord

Set objWordObject = CreateObject ("Word.Application")
objWordObject.Application.visible = true
set objDocObject = objWordObject.Documents.Add(,, 1, True)

If document.form.EnterSection1.value <> "" Then
objDocObject.Content = document.form.EnterSectionI.value
objDocObject.Content = document.form.sectionOptionI.value
End If

objDocObject.SaveAS docFOlder & "C: est.doc"
End Function

What I need now is to plug in some formatting code (obviously before I write and save). Does anyone have any suggestions? Methods?

Thanks in advance...

Command Button To Refresh An Image On A Web Page

I have loaded a web site in a webbrowser1 control which displays 5 images. Now let's say image 4 is always problematic on that page and sometimes doesn't load. How can I create a command button that when you click it, re-loads just image 4 on that webpage. I don't want to have to refresh the whole page.



Refresh Embedded Web Page Handling As Event
ITtoolbox Portal for Visual Basic -

Trying to embed a web page to stream up to date info to users, but
refreshing the web page is being read as an event and is bringing the focus
back to the main login screen (not desired). Any way to periodically
refresh without this occurring?



Request For Refresh Code For Form Page
hi everyone, below is a problem that remain
unsolved for weeks!

I had designed a Salesman Table form page with ADD, EDIT, DELETE, VIEW (crystal report) and EXIT button.
However whenever i edit a record or add a record using the EDIT button, the record will be
updated on my SQL Server database, but when i try to view it on the form page the record remains
the old one.

And the only way to view the new record is to EXIT from the form, and log in again to view
the latest EDITED or ENTERED record. If possible can anyone provide me with a REFRESH code for my
form so as to view the new or edited record on the instant w/o exiting the form.

Thanks A MILLION...

Open Website On Current Opened Page
hiiii guyessss

i want some one help me to solve this question , i want to open any URL website like " " but i want to open it on current active explorer page not on new page okkk because i searched more about it but i found code can open Url on anew explorer nooooo , i want to open it on current active explorer okkkk

please help me fast

How To Refresh A Web Page And Auto Acknowldge The Retry Message?
I have launched a shell'd IE window and occasionally it gets stuck with a page cannot be displayed messaged. Well in my timer I am scanning for IE windows and when it finds a windows with such a message, I issue a IE.REFRESH command. The trouble is that the windows are submitting information, so the window just sits there waiting for the user to hit the retry button. Is there anyway to refresh the IE Page and not have the retry message come up, so it's transparent to the user?

Thanks for looking


Common Dialog &"Current Page&" Driving Me Nuts
Hi all,
I have a question, for printing out something I use the common dialog:

VB Code:
With CDLG        .Copies = 1        .PrinterDefault = False        .Min = 0        .Max = 99        .Flags = &H4                '.CancelError = True        .DialogTitle = "Select Printer"        .Flags = cdlPDHidePrintToFile Or cdlPDPageNums Or cdlPDNoSelection        .FromPage = 1        .ToPage = 9        .ShowPrinter        Debug.Print    End With

Does anybody know how to ENABLE the "current page" option?

Word - Loop Through Each Page In Document And Copy Page With Page Format
Here's what i'm trying to accomplish

1 - Start at first page and get page format (portrait/landscape)

2 - Copy page and paste it into a new word document with original format

repeat these steps until all pages have been copied

I need the condition where a document has both portrait and landscape pages.

Anyhelp would be appreciated

Cannot Refresh Data Using Crystal Viewer Refresh Method
I am using crystal report 8.5 and Visual Basic 6.0

I get an error for this code.


error :

Method 'Refresh' of object 'IcrystalReportViewer' Failed

thank you ....

regards pragash...

Current Position On Current Line *resolved- Code I Used Inside*
this is for VBA but i dont think it will matter if you know a way to do this in VB6 that would be great i will try to convert it from there on my own thanks

ok my question is that i have a textbox on a worksheet in excel and i want to be able to find out what the current position on the current line that im on. here is what im trying to do. ok i am first off converting a file from a emacs file to beable to be read and looked at in windows. and the tab stops to look right in windows. in emacs it make the tabs 8 spaces long and for some reason they are only like 5-6 or so in the textbox. and i want to beable to take a chr(9) which is tab and replace it with space(8) but here is where the problem is.

when you are in the first space on a line it and hit tab in emacs it moves over 8. then of you are on the 2nd it moves over 7 and goes to the same spot as the last tab this happens all the way over to space 8 where it starts over. and i need to be able to detect want spot the chr(9) was found on so i know how many spaces to go over. well hopefully someone can help. i currently dont have any code writen really. all i have is the code the replaces all chr(9) with space(8) if you want i can post that so you can look at how i do stuff.

well thanks for your help and hope you read this soon thanks

Get Current Month On Current System Language?[SOLVED]
Hi.Is there a way to msgbox the current month but on system language?This : [vb]msgbox Format$(Date, "Long Date")[/vb] would msgbox date, date num. etc in your own language but I only want to msgbox the month.

So how can i do this?


Copyright © 2005-08, All rights reserved