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




Word - Read Page By Page


Hi guys,

I'm creating macro to send Word document as Fax to an API. From the Word template, I need to pick up three fields (Fax No, Sender Name & Subject) from each page and send the particular page as Fax. Then I need to jump to next page and select the next 3 fields and send that page as Fax.
I know how to search the fields in the document by using Code:Selection.Find.* command. But how do I read Page by Page? Currently, it always goes back to the first page when I do the search.

Please help.

P.S. The document is created by using Mail Merge and may consists hundreds of pages.

 




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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

Page Number && Page Count In Word (automation)
I think I've searched quite everywhere for this, and I haven't found any information at all. I want to be able to write (in VB) the page number and page count in the footer of a Word document, using Automation. I can alreay write the page number OR the page count, but not both, and I can' t add text to the footer.

I want something like "Page 2 of 5" in the footer of every page of the Word document, but I can't seem to get the hang of it, and I've run out of options. Thanks to anyone taking the time to read this post, and many thanks to anyone with a possible solution!

Raggart

How Can I Select ONE Page Of A Multi-page Word OLE Document?
Hello,

I have the following code that works just fine as long as I have a Single-page word document loaded. However, I need to Select EACH page individually and rasterize into a TIF image. You will note that I am able to Find Text and Select the Entire Line. I can also Select the ENTIRE document using the "OLE1.object.Content.Select" method. But I just can't seem to figure out how to select a Single Page!!!


Once I use the ".Copy" method I AM able to "Paste" it into my Imaging Viewer (Pegasus ImagXpress) object. It is critical that I save these pages individually. Here is the code I'm using for this:
Code:
Private Sub Command3_Click()

    OLE1.DisplayType = 0 ' Display object in the control
    

    OLE1.CreateEmbed "C:Merged.doc", "Word.Document"
    
    OLE1.DoVerb vbOLEActivateGetFocus
    OLE1.SizeMode = vbOLESizeStretch
     
    'Find Text
    With Selection.Find
        .ClearFormatting
        .MatchWholeWord = True
        .MatchCase = False
        .Forward = True
        For i = 1 To 10
            .Execute FindText:="Client Account #:"
            DoEvents
            If .Found Then
                With Selection
                    .EndOf unit:=wdLine, Extend:=wdSelStartActive
                    ' Copy the selection to the Clipboard
                    .Copy
                    ' Paste the entire selection into the Text1 form field
                    Text1.Text = Trim(Clipboard.GetText)
                    ' Break out the Account # and paste it into the Text2 field
                    Text2.Text = Right(Text1.Text, Len(Text1.Text) - InStrRev(Text1.Text, ":"))
                End With
            End If
            DoEvents
        
            'Select the entire document
            OLE1.object.Content.Select
            
            With Selection
                .StartOf unit:=wdGoToAbsolute extend:=wdline
                'Copy selection to clipboard
                .CopyAsPicture
            End With
            DoEvents
          
            Form2.ImagXpress1.Paste
            MsgBox Form2.ImagXpress1.ImagError ' Shows Zero if No Error
            Form2.ImagXpress1.Refresh

            Form2.Show
            
            DoEvents
            'Goto next page
            Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext
        Next
    End With
     
' OLE1.Close
    
End Sub

Thanks,
Jacob



Edited by - JacobRusso on 11/18/2003 5:05:10 PM

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

HELP!!

Displayed Page Number Vs. Word Page Num
I'm trying to get the page num which appears in the footer using the {PAGE} field into a VBA variable. I've tried using:

Selection.Information(wdActiveEndPageNumber)

but that returns the actual Word page number (ex: 5), rather than the {PAGE} num (ex: 2-1)

Any assistance is appreciated.

01000111

Printer Change Page Orientation From Page To Page
I'm running VB 5. Is it possible to change the page orientation from one page to another.

portion of code:
If page_orientation(gridno) = 0 Then
Printer.Orientation = vbPRORPortrait
Else
Printer.Orientation = vbPRORLandscape
End If

If I use "Printer.EndDoc" before the above code, the program works fine. Each page is a separate 'print-job' with the orientation that I want. A problem arises when I want to print to a .PDF printer: each page is saved as a separate PDF because they're all separate 'print jobs'.

If I substitute "Printer.EndDoc" with "Printer.NewPage", I get the error "orientation property cannot be set within a page". Is there any way to get around this?

Err: 'Page Header Plus Page Footer Is Too Large For The Page' With CR9.0
Dear All

I have a trouble making a report using Crystal Report 9.0. I am working on a project which is developed in vb 6.0. What it actually does is, pick some details from the DB (Access 2000) and shows it on the CR 9.0. I've made a TTX File for the same.

But as I run the report it gives an error msg which says Err: 'Page Header plus Page Footer is too large for the page'

To Mention : I am using the custome page size i.e. 6" x 8"..

Can any body help me plz...

Regards,
K****ij

Err: Page Header Plus Page Footer Is Too Large For The Page Using CR9.0
Dear All

I have a trouble making a report using Crystal Report 9.0. I am working on a project which is developed in vb 6.0. What it actually does is, pick some details from the DB (Access 2000) and shows it on the CR 9.0. I've made a TTX File for the same.

But as I run the report it gives an error msg which says Err: 'Page Header plus Page Footer is too large for the page'

To Mention : I am using the custome page size i.e. 6" x 8"..

Can any body help me plz...

Regards,
Kshitij

[crystal Report] Avoid Printer From Ejecting Page After Printing A 3 Line Page
Im taking a printout in crystal report - but there are only 3 lines and after printing it goes to next page - but I dont want it to goto next page.
Instead I want it to continue the rest of the printing - which may be in some other report etc - to continue printing from where it left behind (maybe one or 2 lines break)
But after printing 3 lines it automatically ejects out the paper and goes to next page
How do I avoid this ?
Thanks




Edit by johnminkjan: Topic Title

Anjanesh

Edited by - johnminkjan on 9/7/2004 12:01:29 PM

RESOLVED - Can't Get Page Setup Dialog To Show Page Size Correctly
Hey guys and gals, I am hoping someone will have an idea on this one . . .

I am trying to show the page setup dialog and prepopulate the values of the page setup dialog before it is shown. All of the form pre-population seems to work except paper size. I can retrieve paper size just fine after the user clicks ok on the form, I just can't seem to set it before the form is populated.

I created a tiny test app to illustrate my problem.


VB Code:
' on a formOption Explicit  Private Sub Command1_Click()    With Printer' Height & Width; Printer object — the physical dimensions' of the paper set up for the printing device; not available' at design time. If set at run time, values in these properties' are used instead of the setting of the PaperSize property.'        .Width = 14'        .Height = 8.5        .PaperSize = vbPRPSLegal        .Orientation = vbPRORLandscape    End With    ShowPageSetupDlg MeEnd Sub '********************************************************************'                IN A MODULE! Option Explicit Const CCHDEVICENAME = 32Const CCHFORMNAME = 32Const GMEM_MOVEABLE = &H2Const GMEM_ZEROINIT = &H40Const DM_DUPLEX = &H1000&Const DM_ORIENTATION = &H1&Const PSD_MARGINS = &H2Const PSD_DISABLEPRINTER = &H20Const PSD_INTHOUSANDTHSOFINCHES As Long = &H4Const PSD_DISABLEPAPER As Long = &H200 Private Declare Function PageSetupDlg Lib "comdlg32.dll" _    Alias "PageSetupDlgA" (pPagesetupdlg As PageSetupDlg) As Long Private Declare Sub CopyMemory Lib "kernel32" _    Alias "RtlMoveMemory" _    (hpvDest As Any, _    hpvSource As Any, _    ByVal cbCopy As Long) Private Declare Function GlobalLock Lib "kernel32" _    (ByVal hMem As Long) As Long Private Declare Function GlobalUnlock Lib "kernel32" _    (ByVal hMem As Long) As Long Private Declare Function GlobalAlloc Lib "kernel32" _    (ByVal wFlags As Long, _    ByVal dwBytes As Long) As Long Private Declare Function GlobalFree Lib "kernel32" _    (ByVal hMem As Long) As Long Private Type POINTAPI    x As Long    Y As LongEnd TypePrivate Type RECT    Left As Long    Top As Long    Right As Long    Bottom As LongEnd TypePrivate Type PageSetupDlg    lStructSize As Long    hwndOwner As Long    hDevMode As Long    hDevNames As Long    flags As Long    ptPaperSize As POINTAPI    rtMinMargin As RECT    rtMargin As RECT    hInstance As Long    lCustData As Long    lpfnPageSetupHook As Long    lpfnPagePaintHook As Long    lpPageSetupTemplateName As String    hPageSetupTemplate As LongEnd TypePrivate Type DEVMODE_TYPE    dmDeviceName As String * CCHDEVICENAME    dmSpecVersion As Integer    dmDriverVersion As Integer    dmSize As Integer    dmDriverExtra As Integer    dmFields As Long    dmOrientation As Integer    dmPaperSize As Integer    dmPaperLength As Integer    dmPaperWidth As Integer    dmScale As Integer    dmCopies As Integer    dmDefaultSource As Integer    dmPrintQuality As Integer    dmColor As Integer    dmDuplex As Integer    dmYResolution As Integer    dmTToption As Integer    dmCollate As Integer    dmFormName As String * CCHFORMNAME    dmUnusedPadding As Integer    dmBitsPerPel As Integer    dmPelsWidth As Long    dmPelsHeight As Long    dmDisplayFlags As Long    dmDisplayFrequency As LongEnd Type Public Function ShowPageSetupDlg(frm As Form) As Boolean    Dim DevMode As DEVMODE_TYPE    Dim lpDevMode As Long    Dim m_PSD As PageSetupDlg    Dim bReturn As Integer        On Error Resume Next    'Set the current orientation and duplex setting    DevMode.dmDeviceName = Printer.DeviceName    DevMode.dmFields = DM_ORIENTATION Or DM_DUPLEX'    DevMode.dmPaperWidth = Printer.Width'    DevMode.dmPaperLength = Printer.Height    DevMode.dmOrientation = Printer.Orientation    DevMode.dmPaperSize = Printer.PaperSize    DevMode.dmDuplex = Printer.Duplex    DevMode.dmSize = Len(DevMode)    On Error GoTo 0        'Allocate memory for the initialization hDevMode structure    'and copy the settings gathered above into this memory    m_PSD.hDevMode = GlobalAlloc(GMEM_MOVEABLE Or GMEM_ZEROINIT, Len(DevMode))    lpDevMode = GlobalLock(m_PSD.hDevMode)    If lpDevMode > 0 Then        CopyMemory ByVal lpDevMode, DevMode, Len(DevMode)        bReturn = GlobalUnlock(m_PSD.hDevMode)    End If        With m_PSD        .rtMargin.Top = 0.5 * 1000        .rtMargin.Bottom = 0.5 * 1000        .rtMargin.Left = 0.5 * 1000        .rtMargin.Right = 0.5 * 1000        .ptPaperSize.x = 14 * 1000        .ptPaperSize.Y = 8.5 * 1000        .lStructSize = Len(m_PSD)       'Set the structure size        .hwndOwner = frm.hWnd           'Set the owner window        .hInstance = App.hInstance      'Set the application instance        .flags = PSD_MARGINS Or PSD_DISABLEPRINTER Or PSD_INTHOUSANDTHSOFINCHES    End With        'Show the pagesetup dialog    If PageSetupDlg(m_PSD) Then        ShowPageSetupDlg = True'        sngMarginTop = (m_PSD.rtMargin.Top) / 1000'        sngMarginBottom = (m_PSD.rtMargin.Bottom) / 1000'        sngMarginLeft = (m_PSD.rtMargin.Left) / 1000'        sngMarginRight = (m_PSD.rtMargin.Right) / 1000'        sngPageW = (m_PSD.ptPaperSize.x) / 1000'        sngPageH = (m_PSD.ptPaperSize.Y) / 1000                ' Get DEVMODE structure from PRINTDLG        lpDevMode = GlobalLock(m_PSD.hDevMode)        CopyMemory DevMode, ByVal lpDevMode, Len(DevMode)        Call GlobalUnlock(m_PSD.hDevMode)        ' Set default printer properties        On Error Resume Next        If Not (Printer Is Nothing) Then            Printer.Copies = DevMode.dmCopies            Printer.Orientation = DevMode.dmOrientation            Printer.PaperSize = DevMode.dmPaperSize'            lPaperSize = DevMode.dmPaperSize            Printer.PrintQuality = DevMode.dmPrintQuality        End If        On Error GoTo 0    End IfEnd Function


Thanks in advance for any insight!

**RESOLVED**Crystal Reports / Make Subreport Flow From Page To Page
I have a Crystal Report with a number of subreports. One of the details sections of the main report includes a subreport. I would like it if when I ran the report, it would allow the subreport to be split within several pages. Currently, the subreport shows up on page 2. I would like it to be split between pages one and two.

This is what makes this problem interesting. The subreport exists in the Details d section of the main report. Details d is not checked as Keep Together or New Page Before. The details section before Details d (Details c) is not checked for New Page After. If you go into edit subrebort for Details d, the Report Header has New Page Before checked off, but it is disabled (I can't change it).

How do I make this subreport flow across pages? Why is the Report Header section of my subreport checked for New Page Before but does not allow me to uncheck?

Read A Different Code Page
Hello to all users.

Is there a way to read text data that
was written in different code page ?

lets say :

When access read data from text file "GET position,myRecord"
He uses the default code page.

Now , i want to read data from a text file ; but i want to
"tell access" that this text file was originally written in code page "437"
and i want access to read this file ; using this different code page .

hope you solve my problem ;
for now i'm trying to use : gdi.TranslateKeyCode
that was written in c ,without no lock !!

How To Read Text Of A Web Page?
I want to read all text from a web page. how to do it?

Read Web Page From ActiveX EXE
I would like to process the text of a Web Page to determine if certain keywords are found. What is the best way to do so? Can I implement the INet control in an ActiveX EXE? Is there a better way?

Thanks!
Kevin

How To Read/Set Field On Web Page
Can anyone tell me the syntax for reading or setting the userId and password fields in the following snippet of html code? I know it is WB.Document.????

Thanks, in advance!

Code:
<blockquote>
<br>

<STRONG><FONT FACE="arial,helvetica" SIZE=3 color="#003399">Proprietary System Notice </FONT></STRONG>
<P>
<CENTER>
<FONT FACE="arial,helvetica" SIZE=2>
THIS SYSTEM IS INTENDED TO BE USED SOLELY BY AUTHORIZED USERS IN THE
COURSE OF LEGITIMATE CORPORATE BUSINESS.
<P>
USERS ARE MONITORED TO THE EXTENT NECESSARY TO PROPERLY ADMINISTER THE
SYSTEM, TO IDENTIFY UNAUTHORIZED USERS OR USERS OPERATING BEYOND THEIR
PROPER AUTHORITY, AND TO INVESTIGATE IMPROPER ACCESS OR USE.
<P>
BY ACCESSING THIS SYSTEM, YOU ARE CONSENTING TO THIS MONITORING.
</FONT>
</center>
<hr>

    <p align="left">&nbsp;&nbsp;&nbsp; Please log into the system:<br>
    </p>

<FORM>

          <strong>User ID<br>
          </strong><input type="text" name="userId" size="20">

</form>
<form onSubmit="return search()">
          <input type="hidden" name="userId">
          <p><strong>Password</strong><br>
          <input type="password" name="password" size="20"></p>
          <p><input type="submit" value="Submit">&nbsp;
          <input type="reset"value="Reset" name="B2" ONCLICK = "clearInputFields()">
          <input type="hidden" name="TXN" value="Login">
</form>

</blockquote>

Crystal Reports - Cross Tab - Forcing Virtual Page On Every Page
I have created a crystal report which contains multiple detail sections (Da-Di). Each detail section contains a subreport, which contains a cross-tab.

I have done this because I need to create one excel spreadsheet which contains data from different types of cross tabs.

For example, one cross tab lists accounts and totals, the second lists accounts and totals by cost centre (17 of these), and a third lists accounts and totals by product group (11 of these).

I have lined up all the columns perfectly, and when I export to Excel (Data only), it works perfectly, and I get all the rows and columns of all the cross-tabs in one excel worksheet. Brilliant.

However, when I print, preview or export to pdf, I only see the "real" page and do not see any virtual pages that are shown in each of the sub-reports.

How can I print or view this from the main report and get the virtual pages as well, without stuffing up my export to excel?

Any suggestions would be greatly appreciated.

Tab Pages Lose Data Modifications When Switching From Page To Page
I have a Tabbed two-Page data entry and viewing form that allows the user to select a key from a listbox and view, delete, and alter 22 data items relating to the selected key. The list is bound to a dataset table. When the user selects an item in the listbox, all data (21 columns worth) relating to the key are displayed on the pages using the "rows().item()" feature to select the data from the dataset. The problem is, when I modify any of the data on one page and click on the other to modify more data, the data from the first page is reset to the original data. Is there a way to cause the tabpage feature to stop resetting the Key list selected index each time a different page tab is clicked? Thanks.

ASP.NET Passing Argument From Code Behind Page To Client Function In Another Page
I am Using a VBSCRIPT function where an argument is needed.

This Page is called from another page.
Response.Redirect(Print.aspx?url=http://localhost/sample.doc")

I need the url to pass to VBScript Function. But url is available in Server Side. How to pass it to client Function.

I am using ASP.NET

Thanks in Advance.

Retreiving The Values Of Controls Of Previous Page On Current Page In Asp.net
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

regards

Sanjish

How To Retrieve Child Node Values From An Xml Page Into An Asp Page
Hi I am having a xml file which is generated by a server.I wanted to get some values into my asp page.

The values i need are code in the below tag
<upload-item code="9780020360780" timestamp="1023180336000" symbology="11"/>

and
title and description in the below tag

<parameter key="title" value="The Shipping News"/><parameter key="desc" value="Macmillan Publishing Company, Incorporated"/>

Importantly I have 2 sets of each values.You can see this in the attachment.I am able to get 1st set of values.To get them I am using the below

To get the code
Set y = objDom.documentElement.selectNodes("body/response/codes/mapped-code/upload-item")

varcode=y.item(0).getattribute("code")

Set x = objDom.documentElement.selectNodes("body/response/codes/mapped-code/mapping/parameter")

'if x.length>0 then
'varTitlekey = x.item(1).getattribute("key")
'varTitleValue = x.item(1).getattribute("value")
'varDescKey = x.item(2).getattribute("key")
'varDescValue = x.item(2).getattribute("value")
'Response.Write varTitlekey & varTitleValue
'Response.Write varDescKey & varDescValue
'end if
How to get the 2nd set of values??Any help?/Any good web sites??

URGENT: Data Report (Page Header On Each Page)
Hi,

I am using Data Report (why?!!) to print a bill. It contains the company name and other information such as date and total amount etc.

I am doing this by coding only. NO DATA ENVIRONMENT (!).

I have put a lable on the Page header and I am displaying the company name in that lable. It prints perfactly on the first page of the bill. But it does not appear on the second page of the bill. Instead it displays the remaining items of the bill from the beginning.

I want to print company name on each page of the bill. this is shown in the image.

Is there a way to get the out put like this?

Please help me. Its urgent.

Thank a ton in advance.

How Can I Setup Print Page To Half Of A4 Page With Datareport?
I would like to print selling bill ,and the size of page is half of A4 pagesize,
How do coding with datareport?
Thanks in advance..

Page Up Page Down Not Working With Crystal Designer In VB Project
His all,

its been a long time i m having a problem using Crystal Report with Visual Basic Project.

Question 1:
--------------
Page Down and page up key doesnt work on crystal report previewer(crviewer control). though its working with Crystal Report IDE..but not with visual basic crviewer control.

when we press page down and page up key on report..it goes to the end of the page..not goes to the next page or previous page..


I m using VB6 with Crystal Report 9.

well .. may be few of you have experienced about this bug in crystal report.


Question 2:
--------------
if i want to catch the keypress on crviewer control and i set the form's KeyPreview property to yes..... it only catches Enter Key.. or Function keys.. none other than that..

so..
how should i trap the keys... and set the task for the specific keys.


need your help buddies...
thanks in advance

c ya

Download An HTML Page And Read From It
I want to write an external VB program which watches a forum for new posts and reports them to an IRC channel. I was thinking about how to do this, and I figured the best way would be to read from the "new posts" page every 30 seconds or so and check for changes.

So my question is: How would you use VB to download a html page?

Also, if you know of a better strategy to accomplish this task than I do, please enlighten me.

Read An Internet Explorer Page?
is there an easy way of VB being able to read an internet page that is open in Internet Explorer?

Using VB To Read Data From An Internet Page
Hi,

I am new here and I hope I am placing this question in the correct category. I think I would generally be considered an advanced beginner user of VB. I actually use VB for Access as virtually all of my applications are database related. I hope that is okay.

I want to write an application that accesses URLs on the Internet and records information from those pages. I have no problem pulling the data I need out of the string data in an html file. What I need to know is how to access an html page on the Internet. Also, what, if any references would be needed to be made available under Tools | References. Pointing me to some sample code would be extremely helpful.

To anyone choosing to reply to this: thanking you very kindly in advance.

Rick

Read .aspx Page And Get Values
http://www.mcxindia.com/Market/RealTimeMarketData.aspx

this is a website which displays rates every few seconds is it possible to read the rates and store it in a file

Read Client Registry From ASP Page
Hello!

I'm constructing this for our Intranet, so I can prepare the clients in anyway.
I think it should be possible to read from the registry so I can see what user is logged in to the machine.

Can anyone help me in the right direction to approch this solution?

I Want To Read A File Starting From The Last Line In The Page
I am trying to find a way to read a file starting from the last line in the page, reason why I Want to do that, because this file is always updated and I am watching this file to do something when it find an specific errors. The word could be found in more then one place in the file, by reading the last line this way I don't have to worry if this same error existed before in the file.

Any help is appreciated.

Thanks

How To Read A .aspx Web Page And Store In A File
here is a website which displays rates on a .aspx webpage every few seconds is it possible to read the rates and store it in a .csv

im uploading the image as well as the web page so that u come to know what i want and what is the coding

this is the start i would like to capture data from ALUMINIUM



this is the end of my capture i would like to capture till last line zinc -0.17


also im uploading the html its in the zip file i saved

i would like to store the data in the format in a .csv format


ALUMINIUM,28FEB2007,1,KGS,122.60,122.60,122.60,122.60,123.00,-0.33
CARDAMOM,15FEB2007,1,KGS,,466.50,469.90,463.40,464.90,465.30,-0.09
CARDAMOM,15MAR2007,1,KGS,,498.90,507.00,498.00,500.00,496.50,0.70
CARDAMOM,14APR2007,1,KGS,,529.00,529.00,522.10,525.00,514.50,2.04
CARDAMOM,15MAY2007,1,KGS,,535.00,539.00,535.00,537.00,535.70,0.24

From VB Open HTML Page And Read Text
not using a webbrowser control (or any control if possible) I am looking for a way to open a html page on a webserver and read its text...

for example, the page would sit at http://www.mysite.com/x.htm

x.htm contains an IP address 192.168.0.1

i want to just read that text into a variable.

I accomplished this using the web browser control and MSHTML reference but I would like to do it without... perhaps using windows sockets or something i am not familiar with?

Read Page Info From WebBrowser Control?
I am able to place values on forms that load into my webbrowser control, but
I'd like to be able to scan the page for data. I know to use the
HTMLDocument object.

Basically I'm hoping to find an example of a DocumentComplete routine that
will:

- display a list of all elements (tags?) on the page
- number of forms on the page
- ID, name, type and value for each field on the form
- and how I should handle a page with multiple frames.

I've found numerous examples through Google, but they are all VERY simple as
they assume you know what form index and element names are on the page
already. I can't find any samples that can scan a random page and produce
some output.

Thanks!

How To Read A .aspx Web Page And Store In A File
there is a website which displays rates on a .aspx webpage every few seconds is it possible to read the rates and store it in a .csv

im uploading the image as well as the web page so that u come to know what i want and what is the coding

this is the start i would like to capture data from ALUMINIUM



this is the end of my capture i would like to capture till last line zinc -0.17



also im uploading the html its in the zip file i saved

i would like to store the data in the format in a .csv format


ALUMINIUM,28FEB2007,1,KGS,122.60,122.60,122.60,122.60,123.00,-0.33
CARDAMOM,15FEB2007,1,KGS,,466.50,469.90,463.40,464.90,465.30,-0.09
CARDAMOM,15MAR2007,1,KGS,,498.90,507.00,498.00,500.00,496.50,0.70
CARDAMOM,14APR2007,1,KGS,,529.00,529.00,522.10,525.00,514.50,2.04
CARDAMOM,15MAY2007,1,KGS,,535.00,539.00,535.00,537.00,535.70,0.24





Edited by - rohitb on 2/2/2007 9:35:48 PM

Can VBA In Excel Open And Read Values From A Web Page?
I have figured out how to activate IE, open an URL, but I need to pull a particular value from the page. Here is the web page I'm accessing followed by the code I am using. I need the "CURRENT FLOW" value which is about 3/4 the way down the web page on the left side.



http://waterdata.usgs.gov/mt/nwis/uv/?site_no=06191500&PARAmeter_cd=00060,00065,00010


Private Sub CommandButton1_Click()
 Dim ie As Object
    Dim result As Integer
    Dim myRow As Integer, myCol As Integer
    Dim myURL As String
    '
    ' Get activecell value, must be a valid
    ' web address
    '
    myRow = ActiveCell.Row
    myCol = ActiveCell.Column
    myURL = ActiveSheet.Cells(myRow, myCol)
    '
    ' Set up the Automation object
    '
    Set ie = CreateObject("InternetExplorer.Application")
    '
    ' Navigate to a page and customize the browser window
    '
 ie.Navigate _
    "http://waterdata.usgs.gov/mt/nwis/uv/?site_no=06191500&PARAmeter_cd=00060,00065,00010"
 ie.Toolbar = True ' }set these to true if you want to have the
 ie.StatusBar = True ' }toolbar, statusbar and menu visible
 ie.MenuBar = True ' }
'
    ' keep itself busy while the page loads
    '
    Do While ie.Busy
        Do While ie.Busy
            DoEvents
        Loop
    Loop
 '
    ' Display page info
    '
    result = MsgBox( _
        "Current URL: " & ie.LocationURL & vbCrLf & _
        "Current Title: " & ie.LocationName & vbCrLf & _
        "Document type: " & ie.Type & vbCrLf & vbCrLf & _
        "Would you like to view this document?", _
        vbYesNo + vbQuestion)

    If result = vbYes Then
        '
        ' If Yes, make browser visible
        '
        ie.Visible = True
    Else
        '
        ' If no, quit
        '
        ie.Quit
    End If

    Set ie = Nothing
End Sub

Page Flip/Page Curl Effect
I am making an intro for a game, and I have a book, that
I need it to look as if the pages are turning...
The only help I found was a JAVA applet, but I dont
want to embed a webbrowser. PLEASE HELP! Thanks
a million in advanced. If you know how to do this - u
are tha man.

Crystal - Suppress Page Footer If Not The Last Page
How can I suppress the page footer in a crystal report unless it's the last page?

Search Page For Data Access Page
NEWBY!!
I have created a Database in Access2000---I'm using a Data Access Page with Recordset to view each record.  (Too many records)

Now, I need a SEARCH PAGE to search by either Company or Invoice Number or PO Number, (I must be able to search by either one of the three listed) to open the Data Access Page.  Once my record has been located, users will need to  modifying and save text.  

I tried creating another Data Access Page with Combo Boxes and Command Buttons that would open the Data Access Page, but was unsuccessful.  

Help!  ASAP

URGENT: Report/ Page Header On Each Page
Hi,

I am using Data Report (why?!!) to print a bill. It contains the company name and other information such as date and total amount etc.

I am doing this by coding only. NO DATA ENVIRONMENT (!).

I have put a lable on the Page header and I am displaying the company name in that lable. It prints perfactly on the first page of the bill. But it does not appear on the second page of the bill. Instead it displays the remaining items of the bill from the beginning.

I want to print company name on each page of the bill. this is shown in the image.

Is there a way to get the out put like this?

Please help me. Its urgent.

Thank a ton in advance.

How Do I Read Registry Keys From An ActiveX UserControl On A Web Page
How do I read registry keys from an ActiveX UserControl on a web page?

I have a usercontrol that needs to read the user's pc registry to determine a path for a specific application and then run that application.

How do I go about doing this?

Thanks in advance!

Word 2000: Delete A Word Page With VBA
I have a Word 2000 Template that has a bunch of bookmarks and a Data Entry Form, that the user creates a New Document off of. When the user creates a new document based on this template, there is a Macro that the user can run that loads a user entry Form allowing the user has to enter data. When the user clicks the OK button on the form the following 2 things happen:
    1. All the bookmarks within the document get updated based on data from the User Entry Form
    2. At the end of the document, a particular Word document (Test.doc) is inserted at the "Attachment" bookmark

Everything works fine the first time the user clicks the OK button. However, if the user reruns the same macro within the same document, re-enters different data on the user entry form and clicks the OK button, all the bookmarks update properly, but the inserted file gets added after the 1st one (the 1st one does not get cleared out) - so the user has 2 inserted files. For instance, the first time the user runs the letter there is 3 pages (2 pages + 1 File), and if the user runs it again, there will be 4 pages (2 pages + 2 Files - 1st one and now the 2nd one), and so on... Basically, each time the user clicks the OK button, the appropriate file keeps getting appended to the end.

My problem is, how can I remove the file (Test.doc) that was inserted on the 1st run before we insert the file on the 2nd run? Is there a way to delete the entire page before we insert the file, that way all the data is cleared leaving me with only 2 pages, before I do my insert? My sample code of inserting the file is below:

    Dim bmRange As Range
    ' This is my bookmark where I want to add the file
    Set bmRange = ActiveDocument.Bookmarks("Attachment").Range
    With bmRange
        .Collapse Direction:=wdCollapseEnd
        ' Insert a Page Break after the bookmark so that file being inserted is on it's own page
        .InsertBreak Type:=wdPageBreak
        ' Insert the Test Document
        .InsertFile FileName:="C:Test.doc", Range:="", _
        ' ConfirmConversions:=False, Link:=False, Attachment:=False
        .Collapse Direction:=wdCollapseEnd
    End With

What Page I'm On In WOrd
How do I figure out what page number I'm currently on in Word?

End Of Page In Word Through VB
I want to create a word document which displays the data from the database in the form of a table(with 2 columns) in the word document.I Have created a new word appliction and then added a Table in that word application through the VB Codes.The no of rows of the table varies .Hence sometimes the table Runs into mulitiple pages.The data from the database is first inserted into the first column of the table in the word document.once the first column reaches the end of page ,next the data is inserted into the second column of the same page.so I want to check when the table has reached the end of the page.so i can start inserting data in the next column of the samepage and once this column is also filled the table should be added on to the next page and repeat inserting the data the same way as above.

New Page In Word From VBA
Greetings

Your help please with this problem with Word v.9.0 VBA

I am creating a word doc from Access2000, the code loops through a recodset and makes a text box and inserts a pic. into the text box. This succeeds except that the pictures are overwritten by the suceeding records. I need therefore to create new page for each new record. However since the focus is set to a text box, upon executing the line of code which should create me a new page, I get this error: "This method or property is not available because the object refers to a text box"

Do Until EOF
Blah
Blah

Make textBox
Fill TextBox with pic
Now make a new page for next pics.

oApp.Selection.InsertBreak Type:=wdPageBreak

Loop

How can I 'deselect' the text box and create a new page is my question.

Many thanks

Word New Page
Hi

I have 3 textbox and i want to put first textbox data to the first page, the second textbox data for the second page and the thierd textbox data for the last page

I use this code but if there is no data in text2 it will give me three pages instaed of tow


VB Code:
appWord.Selection.TypeText Text:=Text1.TextappWord.Selection.TypeTextParagraphappWord.Selection.InsertBreak Type:wdPageBreak appWord.Selection.TypeText Text:=Text2.TextappWord.Selection.TypeTextParagraphappWord.Selection.InsertBreak Type:wdPageBreak appWord.Selection.TypeText Text:=Text3.TextappWord.Selection.TypeTextParagraph


What is the wrong with this code

Thank's

New Page In Word
Ok,

My program writes address labels to a Word template from a database. Avery 5160 standard labels come 30 to a page... There will be days where we have more than 30 labels, though...

My question is:

How do I create a new page in the current open template in Word, but use the same bookmarks as page 1?


VB Code:
Private Sub cmdGetLabels_Click()     Dim template As String    Dim WordApp As Word.Application    Dim WordDoc As Word.Document    Dim WordTemp As Word.Document    Dim docPath As String    Dim intTimes As Integer    Dim strLetter As String    Dim strUser As String    Dim strStatus As String    Dim docPageCount As Integer        '--> Get template and document storage path    template$ = getTemplate     ConnectDatabase           '--> Start MS Word and open template    Set WordApp = CreateObject("Word.Application")    WordApp.Visible = False    'Set WordTemp = WordApp.Documents.Open("C:Documents and Settings" & Environ("Username") & "Application DataMicrosoftTemplatesNormal.dot")    Set WordDoc = WordApp.Documents.Open(FileName:=template$, Revert:=True)      intTimes = 1   With rsCustomerTable Do Until .EOF        Select Case intTimes            Case "1"            strLetter = "A"        Case "2"            strLetter = "B"        Case "3"            strLetter = "C"        Case "4"            strLetter = "D"        Case "5"            strLetter = "E"        Case "6"            strLetter = "F"        Case "7"            strLetter = "G"        Case "8"            strLetter = "H"        Case "9"            strLetter = "I"        Case "10"            strLetter = "J"        Case "11"            strLetter = "K"        Case "12"            strLetter = "L"        Case "13"            strLetter = "M"        Case "14"            strLetter = "N"        Case "15"            strLetter = "O"        Case "16"            strLetter = "P"        Case "17"            strLetter = "Q"        Case "18"            strLetter = "R"        Case "19"            strLetter = "S"        Case "20"            strLetter = "T"        Case "21"            strLetter = "U"        Case "22"            strLetter = "V"        Case "23"            strLetter = "W"        Case "24"            strLetter = "X"        Case "25"            strLetter = "Y"        Case "26"            strLetter = "Z"        Case "27"            strLetter = "AA"        Case "28"            strLetter = "BB"        Case "29"            strLetter = "CC"        Case "30"            strLetter = "DD"           End Select            '--> Insert data in MS Word template                        If Len(rsCustomerTable!Name) <> 0 Then                WordDoc.Bookmarks("" & strLetter & "1").Range.Text = rsCustomerTable!Name                Debug.Print rsCustomerTable!Name            End If                        If Len(rsCustomerTable!Address) <> 0 Then            WordDoc.Bookmarks("" & strLetter & "2").Range.Text = rsCustomerTable!Address                Debug.Print rsCustomerTable!Address            End If                        If Len(rsCustomerTable!City) <> 0 Then            WordDoc.Bookmarks("" & strLetter & "3").Range.Text = rsCustomerTable!City                Debug.Print rsCustomerTable!City            End If                        If Len(rsCustomerTable!State) <> 0 Then            WordDoc.Bookmarks("" & strLetter & "4").Range.Text = rsCustomerTable!State                Debug.Print rsCustomerTable!State            End If                            If Len(rsCustomerTable!Zip) <> 0 Then            WordDoc.Bookmarks("" & strLetter & "5").Range.Text = rsCustomerTable!Zip                Debug.Print rsCustomerTable!Zip            End If                        rsCustomerTable.MoveNext                        vbalProgressBar1.Max = rsCustomerTable.RecordCount            vbalProgressBar1.Value = intTimes                        intTimes = intTimes + 1                    LoopEnd With         '--> Save new document and quit MS Word                MsgBox "There are " & rsCustomerTable.RecordCount & " labels to Print, " & strUser & "", vbOKOnly, "Label Count"                WordDoc.SaveAs "F:SharedCust ServProgramsLabelCreatorPlus estLabels.doc"        'WordDoc.PrintOut        WordDoc.Close (Word.WdSaveOptions.wdDoNotSaveChanges)        WordApp.Quit     Set WordDoc = Nothing    Set WordTemp = Nothing    Set WordApp = Nothing        CloseDatabase           End        End Sub

Word Page #ing
Sorry guys.. this isnt about VB, but i know someone can answer this in a second...

I have a large document in word and I need to start numbering the pages from the 3rd page and call that page #1

Where is the setting to select where to start numbering from?

Thanks
-Matt

How Can You Set The MIME Type So That An HTML Page Can Be Read As MS Excel Format?
Hi, there.

I have heard that it is possible to change the MIME type so that an HTML page can be read or saved by MS Excel. Is this really possible? I've done some searching, but haven't found out how to do this. Do any of you know if this really will work and, if so, how do do it?

Thanks.

Extract A Word From A Web Page...
How would I go about getting a single word from a web page? Lets say I go to iwin.com and want to get the amount for icoins (points) that the user currently has and display it in a text box...how would I do that?

Delete Page In Word From VB
Hi ALL!

This is my first thread in this forum so I hope that I am in the right place.

I am using VB6 to create reports in Word 7-11. The templates that I use contains all pages necesseray for a complete report, however sometimes I only want the first and third page. How do I delete one page the best way?

Regards

/DD

Copyright © 2005-08 www.BigResource.com, All rights reserved