|
hellow to all
i am trying to add the Microsoft Outlook 11.0 Object Library reference to my project , but i can't find it in the COM , where can i find it ?
thxx
|
|
|
|
|
Do you have Office 2003 installed on the machine that you're using Visual Studio with?
I recently went through an MSDN call regarding a problem with my application working with different versions of Office, and they said that you need to install the version of Office you want the application to work with on the development box to get the reference.
Hope this helps...
Lost in the vast sea of .NET
|
|
|
|
|
Hi,
Does anyone know any api that could replace hex character?I want to replace null character(00) into space character(20) when I import a text file into DataBase.Thanks.
|
|
|
|
|
What do you mean by "hex character"? Do you mean a character where you express the character code in hexadecimal?
Hexadecimal numbers are written using the &H notaion. The value 32, or hexadecimal 20, are written as &H20.
To create a character value from a numerical value, you use the Chr function.
If you put those togheter, you get Chr(&H20) to produce a space character.
Do you have problems with the replacing part? How about the Replace function?
---
b { font-weight: normal; }
|
|
|
|
|
LOL - when I saw &H20, I thought it said H2O, and that you were kidding....
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,Guffa
I had solved my problem,thanks.
|
|
|
|
|
'Values for variables on lines 25 - 29, 32, and 36
'must be set prior to running this script.
On Error Resume Next
Dim RegObj
Dim SysEnv
Set RegObj = WScript.CreateObject("WScript.Shell")
'***** Specify the DSN parameters *****
DataSourceName = "Name_of_Connection"
DatabaseName = "Name_of_DB"
Description = "Description of connection"
LastUser = "Default_Username"
Server = "Put_server_name_here"
'if you use SQL Server the driver name would be "SQL Server"
DriverName = "SQL Server"
'Set this to True if Windows Authentication is used
'else set to False or comment out
WindowsAuthentication = True
'point to DSN in registry
REG_KEY_PATH = "HKLM\SOFTWARE\ODBC\ODBC.INI\" & DataSourceName
' Open the DSN key and check for Server entry
lResult = RegObj.RegRead (REG_KEY_PATH & "\Server")
'if lResult is nothing, DSN does not exist; create it
if lResult = "" then
'get os version through WSCript Enviroment object
Set SysEnv = RegObj.Environment("SYSTEM")
OSVer = UCase(SysEnv("OS"))
'check which os is running so correct driver path can be set
Select Case OSVer
Case "WINDOWS_NT"
DrvrPath = "C:\WinNT\System32"
Case Else
DrvrPath = "C:\Windows\System"
End Select
'create entries in registry
RegObj.RegWrite REG_KEY_PATH & "\DataBase",DatabaseName,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\Description",Description,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\LastUser",LastUser,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\Server",Server,"REG_SZ"
RegObj.RegWrite REG_KEY_PATH & "\Driver",DrvrPath,"REG_SZ"
'if WindowsAuthentication set to True,
'a trusted connection entry is added to registry
'else, SQL Authentication is used.
if WindowsAuthentication = True then
RegObj.RegWrite REG_KEY_PATH & "\Trusted_Connection","Yes","REG_SZ"
end if
'point to data sources key
REG_KEY_PATH = "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\" &
DataSourceName
'and add the name of the new dsn and the driver to use with it
RegObj.RegWrite REG_KEY_PATH,DriverName,"REG_SZ"
MsgBox DataSourceName & " DSN Created!"
else
MsgBox DataSourceName & " DSN already exists!"
end if
Set RegObj = Nothing
Set SysEnv = Nothing
|
|
|
|
|
I write some text in my application, I want to export to Microsoft Word, please help me
................
|
|
|
|
|
www.voiceguide.com/vghelp/html/modVbs.htm"
u can also find good reference at Microsoft site
u need to add
1. Microsoft Office lib 10 or 11 or 9
and MicorSoft word 9.0 lib
right click on project
Add referece
and select the above mentined components
bye
|
|
|
|
|
I use RichTExtBox in my application and paste image in to it when i saved it I want it remember all, please help me?
Thanks
................
|
|
|
|
|
hi all,
i'm developin a web application in vb.net 2005 in which i need certain values to be passed to a word document....but i'm unable to do so....can anyone here help me...
Any help will be very kind of you
Thanks..
|
|
|
|
|
this is the function I am using by passing datatable and filename
Private Sub SaveDataToMSWord(ByVal dt As DataTable, ByVal FileName As String)
Try
Dim oldCI As System.Globalization.CultureInfo = _
System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo("en-US")
Dim wapp As Word.Application
Dim wdoc As Word.Document
' Dim strDbFullPath As String
Dim strText As String
wapp = New Word.Application
wapp.Visible = True
wdoc = wapp.Documents.Add
Dim Count As Integer = 0
For Count = 0 To dt.Rows.Count - 1
Dim strDesignation As String = dt.Rows(Count).Item("ConJobTitleManual")
If strDesignation = "" Then
strDesignation = dt.Rows(Count).Item("Others")
End If
strText = dt.Rows(Count).Item("cpyName")
With (wapp.Selection)
.Font.Size = 14
.Font.Color = Word.WdColor.wdColorBlack
.Font.Bold = True
.TypeText(strText)
.InsertBreak(Type:=Word.WdBreakType.wdLineBreak)
.Font.Size = 9
.Font.Bold = False
.TypeText(dt.Rows(Count).Item("cpyAddress1") & "," & dt.Rows(Count).Item("cpyTown") & "," & dt.Rows(Count).Item("cpyCounty") & "," & dt.Rows(Count).Item("cpyPostCode"))
.InsertBreak(Type:=Word.WdBreakType.wdLineBreak)
.TypeText(dt.Rows(Count).Item("cpyCountry"))
.InsertBreak(Type:=Word.WdBreakType.wdLineBreak)
If dt.Rows(Count).Item("cpySIC1") <> 0 Then
.TypeText("SIC:" & dt.Rows(Count).Item("cpySIC1"))
If dt.Rows(Count).Item("cpySIC2") <> 0 Then
.TypeText("," & dt.Rows(Count).Item("cpySIC2"))
End If
End If
.InsertBreak(Type:=Word.WdBreakType.wdLineBreak)
.TypeText(dt.Rows(Count).Item("cpyURL"))
.InsertBreak(Type:=Word.WdBreakType.wdLineBreak)
.TypeText("Tel:" & dt.Rows(Count).Item("ConTelMain"))
.InsertBreak(Type:=Word.WdBreakType.wdLineBreak)
End With
Dim counter As Integer = Count
For counter = Count To dt.Rows.Count - 1
If dt.Rows(counter).Item("cpyName") = dt.Rows(Count).Item("cpyName") Then
strText = strDesignation & vbTab & dt.Rows(counter).Item("conEmail") & vbTab & vbTab & dt.Rows(counter).Item("cpyTelSwitchBoard")
With (wapp.Selection)
.Font.Size = 9
.Font.Bold = True
.Font.Color = Word.WdColor.wdColorBlack
.TypeText(dt.Rows(counter).Item("conFirstName") & " " & dt.Rows(counter).Item("ConSurName"))
.Font.Bold = False
.TypeText(" " & strText)
.InsertBreak(Type:=Word.WdBreakType.wdLineBreak)
End With
Else
Count = counter - 1
Exit For
End If
Next
Next
wapp.Selection.InsertBreak(Type:=Word.WdBreakType.wdPageBreak)
wdoc.SaveAs(FileName)
Dim idoc As Word._Document
idoc = wdoc
idoc.Close()
Dim iapp As Word._Application
iapp = wapp
iapp.Quit()
wapp = Nothing
GC.Collect()
Catch ex As Exception
msgbox(ex.Message)
End Try
End Sub
if it does not work then your asp_net user do not have rights to use the word. go to control panel and in user accounts change the asp net user from limited to adminsitrator. Hopefully this will reolve your problem.
Regards
Rizwan Bashir
|
|
|
|
|
Thanx rizwan for your help.....but this code works in windows application not in web application...anyways i got a way to get it in web application, but now i have another problem, i have a datagrid in the same application now i want to get that data grid in the word document....can you help me on this.....
thanks a lot rizwan
manik
|
|
|
|
|
Hi
Friend, i need a small help
I want to displya the word document on the web form
with out changing the formate
ie ., i need some control with in which i can display
the word document in the server
Thanks in Advance
|
|
|
|
|
if u add reference office 11 object library then..you can open word.
|
|
|
|
|
Hi everyone,
I am trying to convert a string format date e.g "13/07/2006" to a date. I am getting an error "String was not recognized as a valid DateTime".
How can i convert it to "MM/dd/yyyy" format.
Please reply
thanks,
Sanded
|
|
|
|
|
Use the DateTime.ParseExact method.
---
b { font-weight: normal; }
|
|
|
|
|
hey
u can use any of this...
1.FormatDateTime(frDate, DateFormat.ShortDate)
2.cDate(frdate) this is best method to convert ur string .
Parag
|
|
|
|
|
first import System.Globalization namespace
'create an object of culture info
Dim myCI As New CultureInfo("en-US", False)
'take culture info's clone
Dim myCIclone As CultureInfo = CType(myCI.Clone(), CultureInfo)
'customise its date pattern
myCIclone.DateTimeFormat.DateSeparator = "/"
myCIclone.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"
'parse date string with this pattern
DateTimePicker1.Value = DateTime.Parse("13/07/2006", myCIclone.DateTimeFormat)
and u have done !;)
milan
|
|
|
|
|
thanks milanatdigi,
Your solution was helpful. While the Solution provided by other guys created the same error message but i really appreciate their help as well.
thanks,
Sanded
|
|
|
|
|
my application is actually a web application where i manually upload CSV file to the database.but i want to automate the process,so i have thought of a second stage to this application i.e through a windows application i would download the CSV file from the NSEIndia.com site automatically and then upload the same to SQLServer on the server.i am facing a problem with upload i.e exporting the data to the database.it would be a great help to me if any one could provide me a solution either in VB.Net code or C# code.
AMIT(TATA CMC)
-- modified at 1:47 Tuesday 11th July, 2006
|
|
|
|
|
Hi All ,
I'm new in VB6.I have some doubts regarding forms.Basically my project consist of 2 forms(Form1 & Form2).Form1 is working perfectly fine.But when Form2 is load,the functions in it tends to slow down.But the codes is the same as Form1.Anyone met this prob before?I tried setting the timer faster but the outcome is the same.Thanks in advance.
|
|
|
|
|
Never heard of the problem before. There's go to to be something in your code that's doing it. You mentioned Timers? Are you doing things on both forms at the same time? This might have something to do with it...
Why are you learning VB6?? It's pretty much a dead product. You can get VB.NET 2005 Express Edition for free here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Oh,i know VB.NET is a more updated version.But i'm handling a project that
is previously done by other people.He uses VB6 so i have to continue with it.
Regarding the timers,at only 1 time,only an event is executed.But i have set timer6 in Form1 as well as Form2.After proceeding from Form1 to Form2,i hope that the events at Form1 won't be executed.But i also don't want to unload it as i need it at a later part.I cant possibly declare all timers disabled at Form2 as there are a large number of timers at Form1.So i hope someone can help me with this.Thanks alot.
|
|
|
|
|
K718 wrote: as there are a large number of timers at Form1
Uhhh, yeah. You might have found your problem.
Your explanation of what each form is doing is far from useful. All I know is that your using a large number of Timers, which is not a good idea. Since every one of those timers is firing it's "Tick" event on the UI thread, your Timers are probably bogging down your entire application.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|