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




How To Use Microsoft Graph Object


Hi, can anyone give me some simple code of VB in dll using microsoft graph 8.0/9.0 ? The component should receive some parameters such as data of X-axis, Y-axis and title etc., and draw the bar chart on screen. I had tried to search Microsoft site, but I found that it is too difficult to search what I want.Thank you !Simon Kwan




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Microsoft Graph 9.0 Object Library
Hai



How to use Microsoft Graph 9.0 Object Library In VB.



I like to use it to create Pert Chart.



Regards,

Karnan.S

Error:Change Y-axis Of Scale Of &"Microsoft Graph 2000&" Graph
Error:Change y-axis of scale of "Microsoft graph 2000" graph


A graph object can be accessed (to change the scales) this way in an Excel application.
With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlValue)
.MaximumScale = 15
.MinimumScale = 5
End With

What is the equivalent in an Access 2000 application or Visual basic? I am trying to change the max and min on the y-axis (of a linear graph OLE Class: Microsoft graph 2000 chart and class: MSGraph.Chart.8) based on the data I am plotting. Each of the code (tries) below gives me an error such as “object doesn’t support this property of method”

With Me.[ContractLinearGraph].Axes(2)' this blows up
'With Me.[ContractLinearGraph].axes(xlvalue) ' this blows up
'With Me.[ContractLinearGraph].Chart.Axes(xlValue)' this blows up
'With Me.Application.ChartObjects("ContractLinearGraph").Chart.Axes(xlValue) ' this blows up

If bPlottable Then
.MinimumScaleIsAuto = False
.MaximumScaleIsAuto = False
.MinimumScale = CDbl(yaxisMinimum)
.MaximumScale = CDbl(yaxisMaxmum)
End If
End With

OLE Microsoft Graph
Hi,
I am using a OLE (microsoft graph) control to create Graphs.
I need to assign the Chart type in run time using VB code.
OLE1.chartType = VtChChartType3dBar does not work as
it does not recognize chartType.

I could double click on the control during run time and change the
charttype but this is not what i want to do.

Any help would be appreciated.

Thanks in Advance,

Rann.

OLE Microsoft Graph
Hi,
I am using a OLE (microsoft graph) control to create Graphs.
I need to assign the Chart type in run time using VB code.
OLE1.chartType = VtChChartType3dBar does not work as
it does not recognize chartType.

I could double click on the control during run time and change the
charttype but this is not what i want to do.

Any help would be appreciated.

Thanks in Advance,

Rann.

Microsoft Graph In XP
Hi all,

I am currently migrating our Access '97 databases to Access XP. Many of them have reporting functions etc that have embedded Microsoft Graph charts.

Because the charts are driven by user-selected criteria (all the required data is pulled back from SQL server depending on user selections and then presented on the graph) when the form loads, the row source is set to nothing. This also saves time on loading as some forms have many graphs.

Now, in '97, Access was perfectly happy having no row source set for a chart. XP on the other hand is not a happy bunny, and throws me "An error occurred while sending data to the OLE server" for every chart on the form. Set warnings is not helping

Has anyone come across this and found a fix? I really dont want to populate each with some random data just to load the **** thing.

Cheers
J.

Microsoft Graph
Hi everyone. I've been searching for a tutorial on how to use Microsoft Graph in a VB 6 application with an access database. Unfortuantely I haven't been lucky. Does anyone know where can I find a good reference?

I need to do a very simple graph but I haven't found good tutorials on the net

Thanx for any replies

Use Microsoft Graph 2000 Chart In VB?
How can I use Microsoft Graph 2000 Chart in VB and connect to an Access database and get the values to the chart? Please help me...

Microsoft Graph And Get Data From Access?
I have created a object in my VB project. Then I include the class MSGraph.Chart.8.
I set a reference to Microsoft Graph 9.0 Object Library.
I test the code like this...

VB Code:
Private Sub Command1_Click()Dim g As Graph.ChartDim db As DAO.DatabaseDim SQL, PathMDB As String PathMDB = "C:Test.MDB"SQL="Select * from tbltest" Set g = Me.OLE1.objectSet db = OpenDatabase(PathMDB, False, False) g.Application.DataSheet.Cells(3, 2) = "11" Set g = NothingEnd Sub

Everything works so far...

But how can I include the SQL statement here:
g.Application.DataSheet.Cells = SQL

If I do like above it doesen't work.

Pass Data To Microsoft Graph (OLE)
Hi,

I've been spending more than 3.5 hours searching the iternet, MSDN, vb Forums and every thing I can think of , on article that can teach me how to control ms graph ole object from VB.

I am so surprise taht I can't find a single one that ask on how to pass a data to the object.

I have my data in Access.mdb.. but I'll have to querry the database first.

Currently i am using microsoft chart (that comes with VB 6.0)... but the 3d bar is too ugly, but the worse case is... if i have 2 points with the same value, and I would like to display a line chart.. the line between these 2 similar vlaues will not be shown.

Is there anytihng I an do to fix the ms chart problem ??

I really desperately looking for the iformation on either passing data to ms graph object or fixing the problem in ms chart.

Any respose is so grealty appreciated.




hendra wijaya

Microsoft Graph Chart (GRAPH9.EXE)
Hi, folks
This is insertable object and can be placed to form.
I would need some advice how to control it.
For example:



When you are in designmode and doubleclick this control it gives youtoolbox, spreadsheet and chart.
But when You press F5 (run) and then doubleclick the control it actssame way but don't show toolbox.
And how to show the chart in form after doubleclick. I didn't find anyway to return to same mode where I was before opening this chart todesign.

I would appreciate Your advices or site adresses where I could foundexamples and/or tutorials.

<Toby />

Microsoft Graph More Than 4,000 Data Points
Does anybody know how to plot more than 4,000 data points with Microsoft Graph in an Access form or report?

Using Microsoft Graph From Visual Basic
Hi Everybody,

         I want to know is
                 How can we put Tooltips in the Microsoft Graph Chart Object from visual basic?
      I am using the MSGraph.Chart Object in Ole viewer to display the Data in Bar Chart Format.
      Now, I want to display some tooltip for each Bar in the Bar Chart (or PIE in PIE CHART).



Nitin.

Microsoft Graph 2000 Chart
I want to use a chart like the one in Access 2000.
Therefore I included under components... ,
Insertable Object..., Microsoft Graph 2000 Chart.
I can place it on a form, but I don't know how to
feed it with data at runtime.

Thanks in advance!

Using The Microsoft Graph Chart Control Programmatically
I'm trying to use the Microsoft Graph Chart control which I found on the components dialog box under Insertable objects tab.

What I'm trying to figure out is how can I link my flexigrid to the charts datasheet programmatically. I want to take columns 1 & 2 & 3 from my flexigrid and insert them into the chart control's datasheet, how do I do this?


Thanks

Microsoft Graph In VB Updates Slowly When I Use Much Data?
I create a OLE Object in the project with class MSGraph.Chart.8

Then I made a working code. Everything works as I want.
The only problem I have is when I use much data, the chart updates very slowly. I can't figure out how I should get it to work faster. Can anyone help me?

Code:
Private Sub Command1_Click()
Dim intRowMax As Integer, intColMax As Integer, arrData As Variant
Dim i As Integer, j As Integer
Dim sSQL, StrWhere, GetTmpPath As String
Dim db As DAO.Database, oRS As DAO.Recordset
Dim objGraph As Object, objDs As Object

On Error Resume Next

GetTmpPath = "C:"

sSQL = "SELECT 'q' & [tblrekl]![Quarter], tblrekl.Gas, tblrekl.Oil, tblrekl.Diesel From tblrekl "
StrWhere = "WHERE tblrekl.Quarter Between '" & frmForm1.List1.Text & "' And '" & frmForm1.List2.Text & "' GROUP BY 'q' & [tblrekl]![Quarter];"

Set db = OpenDatabase(GetTmpPath & "MyDB.MDB", False, True, ";pwd=********")
Set oRS = db.OpenRecordset(sSQL & StrWhere, dbOpenDynaset)
If Not oRS.EOF And Not oRS.BOF Then 'get field and record counts

Set objGraph = Me.OLE1.object
Set objDs = objGraph.Application.DataSheet

'Use the GetRows record set method to return the data in an array
'Set objGraphGetRows to some reasonably large number to accommodate the data
'it will only fill the array with the actual amount of data returned

arrData = oRS.GetRows(500) 'The program never use more than 500 columns...
intRowMax = UBound(arrData, 1)
intColMax = UBound(arrData, 2)
'Graph's Data Sheet cells are in row, column format,
'starting at 1,1 with the row headers
'GetRows data array is in column, row format starting
'at 0,0, where row 0 is the first row of data; no field headers

objDs.Cells.Clear 'Clear out any previous data

For i = 0 To intRowMax
For j = 0 To intColMax

objDs.Cells(i + 2, 1) = oRS.FIELDS(i + 1).Name 'Add the data series names
objDs.Cells(i + 2, j + 2) = arrData(i + 1, j) 'Add the data to each column
objDs.Cells(1, j + 2) = arrData(i - intRowMax, j) 'Add the column heads from the recordset's fields to the data sheet

Next j
Next i

objGraph.Axes(xlCategory).AxisTitle.Text = oRS.FIELDS(0).Name ' Set the AxisTitle text

oRS.Close

objGraph.DisplayBlanksAs = xlZero ' If the value is null then set it to Zero.

Else
'If the querie returns null then show a msgbox and exit the sub.
MsgBox "There is no values on the current period", vbCritical, "Information"
Exit Sub
End If

objGraph.Refresh
Set objGraph = Nothing 'Clear
DoEvents
Set objDs = Nothing 'Clear

End Sub

Microsoft Graph In VB Updates Slowly When I Use Much Data?
I create a OLE Object in the project with class MSGraph.Chart.8

Then I made a working code. Everything works as I want.
The only problem I have is when I use much data, the chart updates very slowly. I can't figure out how I should get it to work faster. Can anyone help me?

VB Code:
Private Sub Command1_Click()Dim intRowMax As Integer, intColMax As Integer, arrData As VariantDim i As Integer, j As IntegerDim sSQL, StrWhere, GetTmpPath As StringDim db As DAO.Database, oRS As DAO.RecordsetDim objGraph As Object, objDs As Object On Error Resume Next GetTmpPath = "C:" sSQL = "SELECT 'q' & [tblrekl]![Quarter], tblrekl.Gas, tblrekl.Oil, tblrekl.Diesel From tblrekl "StrWhere = "WHERE tblrekl.Quarter Between '" & frmForm1.List1.Text & "' And '" & frmForm1.List2.Text & "' GROUP BY 'q' & [tblrekl]![Quarter];" Set db = OpenDatabase(GetTmpPath & "MyDB.MDB", False, True, ";pwd=********")Set oRS = db.OpenRecordset(sSQL & StrWhere, dbOpenDynaset)    If Not oRS.EOF And Not oRS.BOF Then 'get field and record counts Set objGraph = Me.OLE1.objectSet objDs = objGraph.Application.DataSheet   'Use the GetRows record set method to return the data in an array  'Set objGraphGetRows to some reasonably large number to accommodate the data  'it will only fill the array with the actual amount of data returned   arrData = oRS.GetRows(500) 'The program never use more than 500 columns...  intRowMax = UBound(arrData, 1)  intColMax = UBound(arrData, 2)  'Graph's Data Sheet cells are in row, column format,  'starting at 1,1 with the row headers  'GetRows data array is in column, row format starting  'at 0,0, where row 0 is the first row of data; no field headers        objDs.Cells.Clear  'Clear out any previous data    For i = 0 To intRowMax  For j = 0 To intColMax objDs.Cells(i + 2, 1) = oRS.FIELDS(i + 1).Name 'Add the data series namesobjDs.Cells(i + 2, j + 2) = arrData(i + 1, j) 'Add the data to each columnobjDs.Cells(1, j + 2) = arrData(i - intRowMax, j) 'Add the column heads from the recordset's fields to the data sheet Next j    Next i objGraph.Axes(xlCategory).AxisTitle.Text = oRS.FIELDS(0).Name ' Set the AxisTitle text oRS.Close  objGraph.DisplayBlanksAs = xlZero ' If the value is null then set it to Zero.   Else'If the querie returns null then show a msgbox and exit the sub.MsgBox "There is no values on the current period", vbCritical, "Information"Exit Sub  End If objGraph.RefreshSet objGraph = Nothing 'ClearDoEventsSet objDs = Nothing 'Clear  End Sub

Microsoft Graph Or Chart Of Word Or Excel Control
Hi...
Did anyone know how can i control from visual basic the Microsoft Graph of Office Tools...
please if anyone knows that send me a program with the solution of the problem.

Creating Second Graph Object
ok.. thanks for having a look at this post, now here's the question:

I have created a diagram/graph on a NewSheet in Excel. My question is, is it possible to have a second diagram plotted on this same sheet beside the original one?

For example, a bar plot and a pie plot (or even 2x bar charts) on the same sheet.

Any ideas here?

Thanks, Jeff

Graph Object Problem
I want to use the graph object and plot the Y-axis as well as Y2-axis. Please can any one guide me.

VBA Using ADO To Create An OLE Object (MS Graph)
Help! I am writing in VBA in Access to create a MS Graph in Powerpoint using data from SQL. That is the easy part.

The hard part is figuring out how to modify the graph to use a custom graph (as opposed to the default) there is no listing in help and am having trouble finding a specific book that would tell me what the codes are for the custom graphs.

Does anyone know the VBA code to read an existing Powerpoint presentaiton to get the MSgraph information or where I could find this.

Thanks,

Excel Graph Object
Hi,

I have gone into the Projects/Components Menu and under the Insertable Objects tab and selected the Microsoft Excel Chart, and the Microsoft Graph 97 Chart, but niether of them seem to be able to do anything, they just sit there. I have to be completely missing something because I don't see the point to either of these objects

DNA

Calculating The Area Of A Graph Object
Alright Graph Masters:

I have a “loop” on my graph that is generated from about 332 data points. I need to write a macro that will calculate the area within the loop. Does anyone have an idea on how to accomplish this?


Attached is a picture of the "loop" I'm dealing with.

How To Use Excel Object To Create A Graph
Hi,

I need to know how to create a Graph using the Excel object from VB6. I want to create the graph and paste it to a word document, so I'll need to copy the graph to the clipboard, am I right?
I'll appreciate a little code sample

Thanks!

MSGraph Object: How Do I Disable Or Ignore The Right Mouse Click Over The Graph
Hi all,

I am programming the MS Graph object from VB and cannot seem to be able
to disable the Right Mouse click over the graph - it always spawns a
pop-up menu that allows the user to open or edit the object, which I
want to avoid. Any suggestions?

Thanks in advance,

Paulo

MSGraph Object: How Do I Disable Or Ignore The Right Mouse Click Over The Graph
Hi all,

I am programming the MS Graph object from VB and cannot seem to be able
to disable the Right Mouse click over the graph - it always spawns a
pop-up menu that allows the user to open or edit the object, which I
want to avoid. Any suggestions?

Thanks in advance,

Paulo

Using An OLE Object Such As Microsoft Excel
I have an Excel chart on my form and i would like to retrieve the info from one column to come up with a total in a separate text box.
It is really hard?
Thanks

Microsoft Outlook Object In VB
Can anyone help me...I am trying to figure out how to use the Outlook object in VB 6.0. I have search all over the web and MSDN, but I can't find anything helpful. I thought you would Dim an object as an Outlook.Mailitem, but i get errors when I try to set the parameters. Any help would be great.

Thanks,
Steve

Using The Microsoft Dictionary Object In VB
Hi all,
I know it's possible to embed the Microsoft dictionary object (which I think it used in MS Word) into a vb app because I've seen it done before. The trouble is, I don't know how to do it myself. If anybody has any information then I would be very grateful. Thanks.

Microsoft Scripting Object???
I have been told to...
"use the .Eval method of the Microsoft Scripting Object..."
so that I may preform this...
myText.Text = Script1.Eval(myText.Text)

Where can I get this. I did not see it in my components. I only have MSVB6.0 Learning Edition. Does it not come with access to this?

Can this really be used to evaluate a formula entered into a text box
as if it were VB code? "SOUNDS TOO GOOD TO BE TRUE" I would have checked it out if I would have known how to access it.

Microsoft Word Object 8.0
I am trying to open word in windows 2000 vb enterprise edition, i added the ref and the lines
In Declarations :
Option Explicit
Dim ObjWord as Word.Application
And in Code:
Set objWord = New Word.Application 'the error

Everytime it hits the Set line, i get a ActiveX error, "Cant create object", however, word loads in the process window? Whats wrong here?.. I tried rewriting the code in many other forms, such as Set Obj = CreateObject("Word.Application")
and Word.Application.9, however, none of these sollutions are helping the problem.

Microsoft Word Object
I made an aplication that use the Microsoft Word Object, how i can run this aplication in a machine that does't have microsoft world installed on it, is there any way that i can do this, please help.

Useing The Microsoft JRO Object
Dear All

Don't know if anyone else has come accross this problem but it seems really wierd.

usually when I am developing database applications I give the user the choice to compact and backup the database useing the DBEngine.CompactDatabase method which works fine.

I am currently developing a new databaese app useing ADO, so I thought I would use the new Microsoft JRO object to compact. Something very strange has happened.

The database is Access 97
The app is developed in VB6 SP3
I am useing the mdac 2.5

This is the code I used to compact it


Code:

Public Function fn_DBBackup(ByVal sSource As String, _
ByVal sBackUp As String) As Boolean

Dim objBU As New JRO.JetEngine
Dim Response

Response = MsgBox("Are you sure you can repair the database?" & vbCrLf _
& "You cannot repair the database if it is in use!", vbYesNo, "DB Repair")


If Response = vbYes Then
If bFileExists(sBackUp) Then
Kill sBackUp
End If


If bFileExists(sSource) Then
objBU.CompactDatabase "Data Source=" & sSource, _
"Data Source=" & sBackUp
Else
MsgBox "The source database cannot be found" & vbCrLf _
& "Please check the source information!", vbOKOnly, "DB Source Error!"
fn_DBBackup = False
Exit Function
End If



If bFileExists(sBackUp) Then
Kill sSource
End If

objBU.CompactDatabase "Data Source=" & sBackUp, _
"Data Source=" & sSource


fn_DBBackup = True
Else
fn_DBBackup = False
End If



This works fine, until I try to open the database in Access97. It then display's a message claiming the database is in an unrecognised format.

I thought maybe due to the JRO object being quite a new thing it some how upgraded the version to Access 2000.

This seems not to be the case as when I tried to open it in Access 2000, it says the database was an earlier version.

Does anbody know what is wrong?

I can still open the database in VB and process.

Thanks

Microsoft 2.0 Object Library
Does somebody know where I can find documentation of these components?

Thanks in advance

Ruben
(Montevideo, Uruguay)

Microsoft 2.0 Object Library
Does somebody know where I can find documentation of these components?

Thanks in advance

Ruben
(Montevideo, Uruguay)

Microsoft Word 8.0 Object Library
Hi All,

I am having a problem here ...

When i develop my application in VB, i used the MSWord 10.0 Objecj Library.

The Run function allow me to run a MSWord macro and submitted the parameter to that macro. However, when i run on Win97, the MSWord 8.0 Object Library, the Run function do not support the passing of parameter.

Can anyone advise me on how can i pass the parameter over to the macro !

Thanks,

Microsoft ActiveX Data Object 2.8
Hi, i have a little problem with an app.

My problem is that, in that app, may occour multiple read and write at the same time in a Mysql database. When that multiple read or write occour, ado will crash. Can someone tell me why ado crash in that way?

OLE Microsoft Word Object Issue
Please help,

I have a form that has an OLE object which I am loading a Microsoft word File from a command dialog. The Problems are, (1) I would like a user to be able to save the word file, (2) it keeps refreshing in the window to the top of the document, and (3) there are no scroll bars for the file. Here is the code for my form:


VB Code:
Private Sub Form_Load()Dim sFile As String With dlgCommonDialog.DialogTitle = "Open".CancelError = False.Filter = "All Files (*.*)|*.*".ShowOpenIf Len(.FileName) = 0 ThenMe.HideExit SubEnd IfsFile = .FileNameEnd WithOLE1.SourceDoc = sFileOLE1.CreateEmbed sFileMe.Caption = sFileMe.Top = 0Me.Left = 0 Form_ResizeEnd Sub  Private Sub Form_Resize()On Error Resume NextWith OLE1.Height = 10000.Width = 10000End WithEnd Sub



Thanks,

Xman

Microsoft X.x Access Object Library
Hi all,

I have Access 2003 installed and I need to add the Microsoft Access Object Library to one of my projects so I can use some report functionality, yet, it does not appear in my components list.

Does anyone know how I can get it there? Thanks

Microsoft Access 8.0 Object Library
I am using VB 6.0 both at college and home. For my current and previous project i require the Referance Microsoft Access 8.0 Object Library, and the Component Microsoft Data bound Grid control 5.0(Dont think version matters).
The problem is i recently formatted my HDD, and after reinstalling VB i no longer have the Microsoft Access 8.0 Object Library in my referances. I have a feeling it is something to do with the file 'MSACC8.olb' but don't quote me on that. But i didn't have this problem before i formatted my HDD!
I would appreciate if someone could tell me how i can solve this problem, and if that is the file i need, where can i get it.

Thanks in advance,
Metaphoric

Microsoft Word 9.0 Object Library
Can some someone please upload the Microsoft Word 9.0 Object Library? I am in great need of it and cannot install the latest service pack.

Thanks so much!

Microsoft Office CommandBarControl Object...
I am trying to automate an item on the commandbar "cells" in Microsoft Excel.

I am adding a new item to the menu, and I have some VB code I want it to run when the item is clicked.


Code:
If Not Application.Intersect(Target, Range("F13:F37")) Is Nothing Then
Set ctlTemp = Application.CommandBars("cell").Controls.Add(Type:=msoControlButton, before:=1, temporary:=True)
ctlTemp.Caption = "Search on Assembly #"
ctlTemp.OnAction = "EnterPart"
ctlTemp.Tag = "vlvwiz"
End If



The problem is that in Excel, the OnAction property requires a Macro, not a VB sub/function.

Does anyone know how I could make this Menu Item run my VB code?

Thanks!

Microsoft Forms 2.0 Object Library?
Any one heard about Microsoft Forms 2.0 Object Library. This library allow UNICODE for textbox, cmdbutton & so on.

My Question is, anyone place unicode to form.caption before?

FYI, I'm Using VB6 Ent SP5 (English Edition)

Microsoft Excel Object Library
Where can I get Excel Object Library? I have Excel 2000, I have vb 6, I cannot find the Excel Library...

Microsoft Excel 8.0 Object Library
could you tell me where i can download this library?
For ocx controls we never seen before is there any way of getting some info on it??

Microsoft Word Object Library
Hello,

I would like to incorporate a spell checker? If I reference Microsoft Word 8.0 Object Library and distribute the compliled program to others do they need Microsoft Word?

Are there any in-process spell checkers? I do not want the user to rely on a particular spell checker.

Code:

Dim MSWord As Word.Application

Private Sub Form_Load()

Set MSWord = New Word.Application

End Sub

Private Sub cmdCheck_Click()
Dim text As String
Dim suggestion As Word.SpellingSuggestion
Dim colSuggestions As Word.SpellingSuggestions

If MSWord.Documents.Count = 0 Then MSWord.Documents.Add
text = Trim(txtWord.text)
lstSuggestions.Clear
If MSWord.CheckSpelling(text) Then
lstSuggestions.AddItem "(correct)"
Else
Set colSuggestions = MSWord.GetSpellingSuggestions(text)
If colSuggestions.Count = 0 Then
lstSuggestions.AddItem "(no suggestions)"
Else
For Each suggestion In colSuggestions
lstSuggestions.AddItem suggestion.Name
Next
End If
End If

End Sub

Thanks,
deDogs

Microsoft Document Imaging Object
Hello,

Can anyone please help me with the Microsoft MiDocView1 Object. I want to view a Tiff file using this Object, but do not know how to.

Thanks

BazzaW

Add Ref To Microsoft HTML Object Library
hi

i am working with VBA, and due to the nature of my project, i am using the web browser.

if i go to the visual basic editior in excel, select tools, referecnes, and scroll down and select Microsoft HTML Object Library the code will fire without a hitch.

however, another user might not have Microsoft HTML Object Library referenced and when they go to use the routine it will bug out.

so my question is, how can i code it directly into the VBA to reference the Microsoft HTML Object Library to make sure whoever uses the program doesnt have a problem

thanks

Microsoft Outlook 10.0 Object Library
I'm not sure if this is where I should be posting this. If there is a better location please let me know. Here goes.

I am using VB.Net, but this has more to do with COM objects.

I have referenced the MS Outlook 10.0 Object Library and I am sending email from an app. I can do this with no problem except when I hit the send button I get a dialog box warning me that someone is try to access Outlook and it may be a virus. Click yes to continue. I can hit yes and it works fine. I think the reason I'm getting this is because in my code I should be including the Outlook.NameSpace Logon method. I would include this but the first param is for a profile, 2cd is password, and then there are two more params but not of concern to me. I do believe that if I could set the profile and password to that of one in my Outlook that I would no longer receive this warning. The code looks something like this:

Code:Public Sub SendAssignment(ByVal body As String, ByVal teEmail As String, ByVal trEmail As String)
        ' Create Outlook application.
        Dim oApp As Outlook.Application = New Outlook.Application()
  
        ' Get Mapi NameSpace.
        Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
        oNS.Logon(profile as Object, password as Object, ShowDialog as Object, NewSession as Object) 'here are the problem params

        Dim oMsg As Outlook.MailItem

        oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem)

        With oMsg
            .Body = body
            .Subject = "Tutoring Assignment"
            .Recipients.Add(teEmail)
            .Recipients.Add(trEmail)
            .Display()

        End With

        ' Log off.
        oNS.Logoff()

        ' Clean up.
        oApp = Nothing
        oNS = Nothing
        oMsg = Nothing
    End Sub

If anyone could help out with this it would be greatly appreciated. Thanx in advance.

--kmfan
----------------------------------------------------------------------------
"It's not whether you win or lose, it's whether I win or lose."

Why To Use MicroSoft Forms 2.0 Object Library
Hi,
I have a doubt for which i didnt get clear answer from google or msdn.
Why to use forms 2.0 object library.

Our project is developed with vb6 and msaccess. It has to work independently (without vb & office in client system). Problem is, project was developed using forms 2.0 object library which involves with fm20.dll. So, it works only in the system with office. But our client wants this application to run independently. We have to remove this from our application. As i am new to vb, i dont know if i remove this and use standard vb package (command button, test boxes...) will it affect the application processing with db.

We are using data grids to display data.

any suggestions are appreciated


rajan

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