|
i want to open doc file using vb.net. word doc should open. then i want to convert it into pdf.
sai
|
|
|
|
|
Sounds like you need to look into either .NET or COM interop with Office. IT depends on what versions you want to support, the COM ones are always there, the .NET ones I'm not sure when they came out. Creating PDF, there's a couple of projects on source forge that do it, and plenty of commercial options.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How is it possible to retrieve the WMI property description field with VB 2005 / .net?
Example: for the value
<br />
root\CIMV2:Win32_PerfRawData_SMTPSVC_SMTPServer\MessageBytesTotal<br />
the Property Description is
"The total number of bytes sent and received in messages."
With this code I can get the value of "MessageBytesTotal", however how to get the description into a string variable?
<br />
Dim mc As ManagementClass<br />
Dim menge As ManagementObjectCollection<br />
Dim mo As ManagementObject<br />
Dim strTmp As String<br />
<br />
Try<br />
mc = New ManagementClass("\\MeinServer\root\cimv2:Win32_PerfRawData_SMTPSVC_SMTPServer")<br />
<br />
menge = mc.GetInstances()<br />
<br />
For Each mo In menge<br />
strTmp = mo("MessageBytesTotal")<br />
Next<br />
mc.Dispose()<br />
Return strTmp<br />
Catch ex1 As Exception<br />
console.writeline (ex1.Message)<br />
End Try<br />
Which code do I need to add to get success?
I have tried this here, but it does not work:
<br />
strTmp2 = mo("Description")<br />
Thanks for any hint and feedback!
|
|
|
|
|
AFAIK, there is no way to retrieve the property/method/event descriptions in WMI. You can retrieve the list of properties/methods, and their data types, but not the descriptions.
The only place I know to get that information is in the MOF files that were used to compile the WBEM classes. It would involving parsing those file to get the info. I don't know of an API to do it for you.
I could be wrong though...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you are realy into a bit of work, you could generate your own managed class using mgmtclassgen.exe and just add your own custom property for it.
Read on... for instructions:
The following command generates a managed class from Win32_PerfRawData_SMTPSVC_SMTPServer
mgmtclassgen.exe Win32_PerfRawData_SMTPSVC_SMTPServer /n root\cimv2 /l VB /p c:\SMTPServer.vb
The tool writes the managed class to the source file at c:\SMTPServer.vb, using the ROOT.CIMV2.Win32 namespace.
Add the file to your project.
Add the following to SMTPServer.vb somewhere near "Public ReadOnly Property MessageBytesTotal()" (about line # 2509 in my file.):
<Browsable(True), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
Description("Description of MessageBytesTotal.")> _
Public ReadOnly Property MessageBytesTotalDescription() As String
Get
Return "The total number of bytes sent and received in messages."
End Get
End Property
And/Or whatever you want the property(s) to be..
And/Or Your own overloads ect..
Have fun..
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfmanagementstronglytypedclassgeneratormgmtclassgenexe.asp
-- modified at 1:47 Friday 15th September, 2006
|
|
|
|
|
Hi,
Does anyone know how to send a pdf file to a printer without using Acrobat.
|
|
|
|
|
Without some component to load, parse and render the document, you can't send a PDF to the printer. It'll just print tons a garbage.
TallComponents[^] has a couple of things that might work for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
Hello,
I am using the .Net 2003
I am using the SQL Server 2000
I am using the OleDb Connection Object
I am using the ExecuteNonQuery Method
While Inserting the records Multiple times under transaction control I am getting this Error:
System.Data.OleDb.OleDbException: Connection is busy with results for another commandat System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbDataReader.NextResult()
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
Please Give the soultion for this.
Nagarajan R.J.
|
|
|
|
|
Without seeing the code that's generating this error, it's impossible to tell you what you did wrong. Though, I get the feeling that you're trying to use a DataReader object for something it's not designed for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The code for this as follows
Dim cmdGeneral As OleDb.OleDbCommand
Private Function funInsertRecord(ByRef cnn As OleDb.OleDbConnection, ByRef trans As OleDb.OleDbTransaction) As Boolean
Try
Dim intRowIndex As Integer
Dim intResultCount As Integer
For intRowIndex = 0 To 100
Dim strSQL As String = " INSERT INTO EMPLOYEES(FirstName,LastName) VALUES('RAJ','KUMAR') "
cmdGeneral = New OleDb.OleDbCommand(strSQL, cnn, trans)
intResultCount = cmdGeneral.ExecuteNonQuery()
If intResultCount = 0 Then
funInsertRecord = False
Exit Function
End If
Next intRowIndex
funInsertRecord = True
Catch ex As Exception
funInsertRecord = False
End Try
End Function
Nagarajan R.J.
|
|
|
|
|
Well, there are multiple causes for this, including a bug in SQL Server 2000.
What is going on before you call this sub? Do you have a DataReader open on this same connection? Are you trying to work on multiple result sets at the same time, on the same connection?
MSKB Article[^]
Yahoo Results for error[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm using the Microsoft report to print customer information. I made a setup screen that allows the user to define date ranges to run the report for. Then they click print to run the report. How can I pass the date range information they have chosen to the report so that it prints at the top of every page.
|
|
|
|
|
I wonder if anyone can help me.
I am trying to display my network domain name and IP address of a PC. I have Visual Studio 2003 and running on Windows 2003 server. I am running .Net Framework 1.1
There is a new object isn .NET Framework version 2.0 that is
Imports System.Net.NetworkInformation which runs
Dim ipproperties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
But with .Net Framework 1.1 does not.
Couple of questions
1. Do I install .Net Framework 2.0 on the user PC etc remembering that I have VS 2003
2. How was this done with version 1.1 and VS 2003
|
|
|
|
|
directred wrote: 1. Do I install .Net Framework 2.0 on the user PC etc remembering that I have VS 2003
You could, but your application will not use any of the .NET 2.0 classes. You're restricted to using only .NET 1.0 and 1.1 classes if you compile under .NET 1.1.
If you're talking about getting the DNS domain name, you can get the fully qualified DNS name of the local machine using the System.Net.Dns class as it's GetHostName() method. You can then parse the string to get everything after the first period to get the domain name.
If you're talking about getting the Windows domain name, you can get the domain of the currently logged in user from the System.Environment class and it's .UserDomainName property.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
i have to read each data from a dataset
and check each value in an IF Condition
can u help me
thanks in advance
|
|
|
|
|
A DataSet is nothing more than a collection of DataTable objects, which are collections of DataRow and DataColumn objects.
As with any collection, you can enumerate them this way:
For Each dt As DataTable In myDataSet
Console.WriteLine("Table name: " & dt.Name)
For Each dr As DataRow In dt
Console.WriteLine(" Row field value: " & dr("tableFieldName") )
Next
Next
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks .
it helped me verymuch
|
|
|
|
|
Hi,
Hi frndz. please any body can give FAqs information for me. I urgently need them
NareshT
|
|
|
|
|
FAQ's on what?
You do realise the FAQ stands for Frequently Asked Questions don't you? Hence, there can be an FAQ on anything from .NET all the way through to the Art of Fly Swatting. Please be more specific.
|
|
|
|
|
I"m sorry, your question makes no sense. Why do you urgently need them ? What do you expect 'them' to be ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
I have a datagrid with 4 columns and i want that only 1 column can be "EDITABLE" whereas the remaining 3 cann't be editable.
|
|
|
|
|
Set the other columns to 'ReadOnly'.
Steve
|
|
|
|