Skip to content

Visual Basic

Visual Basic Questions

This category can be followed from the open social web via the handle visual-basic@forum.codeproject.com

34.4k Topics 120.1k Posts
  • Word Automation

    question csharp testing tools
    2
    0 Votes
    2 Posts
    0 Views
    N
    Are you running a web app or a window app? Did you call oDoc.Close? How about oWord.Quit ? God, I pity me! - Phoncible P. Bone If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
  • VB6

    question help
    2
    0 Votes
    2 Posts
    0 Views
    N
    ComboBox1.AddItem "Item" simple, eh! :) God, I pity me! - Phoncible P. Bone If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
  • VB events and Command Buttons

    help
    7
    0 Votes
    7 Posts
    0 Views
    N
    No Prob. I'm glad you got it to work. :) God, I pity me! - Phoncible P. Bone If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
  • Form Referencing

    sales help
    2
    0 Votes
    2 Posts
    0 Views
    R
    If you have two forms, FA and FB, then you can directly reference FB from FA and Vice versa. I would suggest implementing method like UpdateCustID(ByVal NewCustID) on FB, which can then be called from FA: load FB FB.UpdateCustID(NewCustIDFromThisForm) FB.Show Unload Me Note that it's not necessary to load FB first - if you reference a form, then it gets loaded implicitly anyway, but I always tend to do so, since makes the code a little clearer "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
  • ADODB recordset

    c++ database sysadmin help question
    2
    0 Votes
    2 Posts
    0 Views
    R
    My be due to passing the object by value rather than reference (but no promises!) Try : GenerateReport **ByRef** rs "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
  • Extremly stupid VBA question

    question security
    4
    0 Votes
    4 Posts
    0 Views
    R
    NOt necessarily - could be a member variable of his form, and not just a local - maybe it needs to be used by other functions / subs "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
  • Possible Vb Question

    question tools help
    2
    0 Votes
    2 Posts
    0 Views
    R
    Look up the FileSystemObjct on MSDN, or if you fancy doing it by the seat of your pants so to speak, just set a project reference to WindowsScriptingHost (??? - Dunno). With the reference set, something like set oMyFSO = new WindowsScriptHost.FileSystemObject Should allow you to access all sorts of objects and methods for dealing with the filesystem (F2 = Object browser which will prob help!) "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
  • Printing by VB.NET

    csharp graphics question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • How to get the line number

    question help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    S
    Use the Erl function. But in order to get it work, you need to number your lines of code. A very useful tool is MZTools, which can do that and a lot of other very interesting stuff. (http://www.mztools.com/)
  • HowTo: 2's Complement sum checksum?

    csharp html com help
    3
    0 Votes
    3 Posts
    0 Views
    P
    My previous really gives a ones compliment -- not really what you asked for. In order to perform a twos compliment I prsonaklly would revert to tyhe interoperability of the .NET languages and write it in C++, then like it to Visual Basic. If you decide to try that, start a Visual C++ .NET Class library. then add the following code to the file that holds the name you gave the library, compile and link to it. NOTE that the code given works only with 32-bit integers, a similar thing sould be done for larger or smaller integers. int TwoCompl(int val) { __asm { mov eax, val not eax mov val, eax }; return val; }
  • For DB experts only!

    database help question
    3
    0 Votes
    3 Posts
    0 Views
    P
    There is a SQL statement for setting "IDENTITY_INSERT" on or off. With it on, you can insert any legimate value you desire (it can't be a duplicate to what is there). When you are done, turn it back off. syntax SET IDENTITY_INSERT [ database. [ owner. ] ] { table } { ON | OFF } but you need either "owner" or "dba" the rights to the database.
  • vb and vba

    help sysadmin question
    2
    0 Votes
    2 Posts
    0 Views
    P
    Add a reference to the CDO com object and use CDO calls to exchange server. There are several varieties of CDO calls so pick the one that suits your needs.
  • OLE Databinding

    database com
    2
    0 Votes
    2 Posts
    0 Views
    P
    Use the "ExecuteReader" function to obtain a rataReader object. Then you can read the rows one at a time. Alternatively, you can instantiate a DataSet and "fill" it with your connection and then access the data in the dataset as you would any other database, or use it to fill your datagrid. There are actually lots of choices and I'm not sure which best fits your situation pxw
  • reading RTF message Body, outlook automation

    html com testing tools tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Creating A Bitmap?

    com graphics help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Quick question about classes in VB.NET

    question csharp help tutorial
    3
    0 Votes
    3 Posts
    0 Views
    C
    if you want to pass data between forms , you can add owned forms, eg: in Form1: Dim frm As New Form2 Me.AddOwnedForm(frm) frm.Show() in Form2: Dim frmMain As Form1 = Me.Owner frmMain.TextBox1.Text = "something from Form2, passed to Form1!":)
  • access to outlook inbox

    csharp tutorial question
    6
    0 Votes
    6 Posts
    0 Views
    P
    Hi.. I have the following code Dim ie As New SHDocVw.InternetExplorer ie = CreateObject("InternetExplorer.Application") With ie .Visible = False .Navigate("c:\OutLookStyle.html") .ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER) 'printing the file without showing the print dialog System.Threading.Thread.Sleep(5000) 'pausing the application to finish printing End With ie.Quit() But i'm getting the following error whenever the project execute .ExecWB(....) An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in emailPrint.exe Additional information: Trying to revoke a drop target that has not been registered (OR) An error has occurred in the script o this page Line: 288 Char: 1 Error: 'dialogArguments.__IE_PrintType' is null or not an object Code: 0 URL: res://c:\\windows\system32\shdoclc.dll/priview.dlg Do you want to continue running scripts on this page? Yes/No? But I have no problem or whatsoever, if I debug and put a breakline on .ExecWB(..). the html page get printed without showing printdialog as I excepted. If I dont have a breakline at .ExecWB(..) then I got either or both of above errors( in red ) what would be the reason of getting such errors? and How can i print the web page to printer without showing PrintDialog???
  • NetScheduleJobAdd API Alternatives?

    json question
    3
    0 Votes
    3 Posts
    0 Views
    G
    me again, if that fails, you could try ... http://www.cypressnet.com/Products/autotask/autotask.htm 'G'
  • Shaped Forms | vb.NET

    question csharp
    3
    0 Votes
    3 Posts
    0 Views
    Y
    :-D
  • printing to the printer with vb.net

    csharp com tutorial question
    6
    0 Votes
    6 Posts
    0 Views
    P
    I see.. let me see it then..