|
shy boi wrote:
I found this it really helped
What is this? there is no link
You can use bookmarks in Word
|
|
|
|
|
Apologies code block didnt load
Imports Word = Microsoft.Office.Interop.Word
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objWordApp As New Word.Application
objWordApp.Visible = True
Dim objDoc As Word.Document = objWordApp.Documents.Open("C:\Trydata\1.doc")
objDoc = objWordApp.ActiveDocument
objDoc.Content.Find.Execute(FindText:="VB", ReplaceWith:="Visual Basic Express", Replace:=Word.WdReplace.wdReplaceAll)
While objDoc.Content.Find.Execute(FindText:=" ", Wrap:=Word.WdFindWrap.wdFindContinue)
objDoc.Content.Find.Execute(FindText:=" ", ReplaceWith:=" ", Replace:=Word.WdReplace.wdReplaceAll, Wrap:=Word.WdFindWrap.wdFindContinue)
End While
objDoc.Save()
objDoc.Close()
objDoc = Nothing
objWordApp.Quit()
objWordApp = Nothing
End Sub
End Class
|
|
|
|
|
Hi all...
I have made a program in VB.NET(VS 2008) to start a cmd.exe process using Process class.
Code is running perfectly on 32-bit Windows but when I am trying to run same code on 64-bit Windows 7 it is giving an error message that process file not found.
I compiled code for ANY CPU, x32 and x64 and tested separately on 64-bit OS but getting same error message.
Suggest me what should I do.
Thanks.
Gagan
|
|
|
|
|
Please show your code and the exact text of the error message.
|
|
|
|
|
I don't see why that was downvoted, but as mentioned above, more information is required.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I have a problem on passing value from Main Form to 2nd Form. Actually, I have a 2nd Form on the SplitContainer and the SplitContainer is placed inside the Main form.
What I want to do is Click the Button on the 2nd Form from the Button on the Main Form.
Thanks in advance.
|
|
|
|
|
If you move the code out of the button Click event handler and into it's own method, you'll have a much easier time calling that code from other classes (Forms).
|
|
|
|
|
Hi I have a font that I use, but on some PC I can't install it(no rights)
So I wrote a function to use the installed font if it exist or the ttf file
this is the code
Public Function ChessFont(ByVal Grootte As Integer, ByVal style As FontStyle) As Font
Dim f As Font = Nothing
If Settings.ChessFont <> "" Then
f = New Font(Settings.ChessFont, Grootte, style)
End If
If (f.Name.ToUpper <> Settings.ChessFont.ToUpper) Then
If Settings.ChessFontFile <> "" Then
Dim pfc As New Drawing.Text.PrivateFontCollection
pfc.AddFontFile(Settings.ChessFontFile)
Dim ff As FontFamily = pfc.Families(0)
f = New Font(ff, Grootte, style)
'just testing
Dim frm As New Form
Dim l As New Label
l.Font = f
l.Visible = True
l.Location = New Point(0, 0)
l.Size = New Size(200, 200)
l.BackColor = Color.Yellow
l.Text = "kqrbhp lwtnjo"' these symbols I use
frm.Controls.Add(l)
frm.ShowDialog()
'and works fine
End If
End If
Return f
End Function
On the test form I have the correct result but is U use the font
like
Dim F as Font = ChessFont(16,Bold)
e.graphics.drawstring("Test",F,black,0,0)
it is not working. I have times new roman as font
Can someone point me to what i'm doing wrong?
|
|
|
|
|
If you're packaging the font in your app, why are you even bothering with switching between two fonts?? Just use your privately held font all the time so you get a consistent look acrossed all installations.
|
|
|
|
|
I was thinking about to do that to, but for now an installed font works fine and the ttf works in the test form but not afterwoths.
So once it works always when I'm using the ttf-file I gonna use that method always.
However I can not install a font at the office, but I can at home.
|
|
|
|
|
The logic in your posted code doesn't make much sense. I suggest rewriting it to seperate functionality.
The biggest problem I see is that your logic missed cases, like Settings.ChessFont being an invalid font name, or if Settings.ChessFont is empty (use String.Empty instead of "") or null, you go into a second If statement unneccessarily. The comparison you're making in this second If also doesn't amke sense and is completely unneccessary.
If should be if the Settings.ChessFont is empty, or is an invalid name, default to a known font family name.
The first thing I would do is move the code that loads the font family name from settings to its own method. This method would have to load the setting from wherever, then VERIFY that the family name exists in the available fonts, both system and/or in the private collection, then return that name.
|
|
|
|
|
hi experts,
I have rdlc report in asp.net which has two datasource and it added in report data sources list as 'ds_WKSG' and 'ds_WKBC'.
The problem is it only works when I use either one of them. If I will add the second datasource onto my report it gives an error
'A data source instance has not been supplied for the data source ds_WKBC'.
I googled it already but my case is different.
i read already here.. [^]my case is I want to use to datasource in one report.
thanks in advance.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
hi everybody,
I have a table whith a lot an invoice (2007, 2008, 2009 etc)and I want to group the invoice by years (2007, 2008 etc). A client may have many invoice every year.
I try something but I didn't find a solution to SUM value of invoice for all years separately:
SELECT SUM(total_sales) AS year_1, Client
FROM vanzari_totale
GROUP BY DATEPART(
Database is MS Access.
Please is urgent.
Thanks in advance!
|
|
|
|
|
sorin_zan wrote: Please is urgent.
It's only urgent to you. To a bunch of people who volunteer their time for free, it really doesn't matter.
You have to specify one or more column names in the GROUP BY clause, not actual data.
|
|
|
|
|
Not clear.
Why not just pull all invoices by year?
or do you need them totaled?
Or do you want them sorted?
More info please.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Hi!
Could you please check this one: ( without calling DatePart() )
SELECT SUM(total_sales) AS year_1, Client
FROM vanzari_totale
GROUP by invoice_date, client
|
|
|
|
|
Nope. This will group on a daily basis, each distinct invoice_date value belongs to a different group. However, I have a solution, see my other message.
|
|
|
|
|
thanks but don't work...
I find a solution:
TRANSFORM Sum(Vanzari.Valoare) AS SumOfValoare
SELECT Vanzari.Client
FROM Vanzari
GROUP BY Vanzari.Client
PIVOT Month([Data] )
|
|
|
|
|
Hi,
1.
you're in the wrong forum, this is a database question, not a VB one. So the SQL or Database forums are more appropriate.
2.
this works fine on SQL Server:
SELECT COUNT(1), year(payment_date) as year FROM payments GROUP BY year(payment_date)
However it fails on Access, and so does this:
SELECT COUNT(1), datepart("yyyy", payment_date) as year FROM payments GROUP BY datepart("yyyy", payment_date)
However this does it:
SELECT COUNT(1), datepart("yyyy", payment_date) as yr FROM payments GROUP BY datepart("yyyy", payment_date)
so the only problem was SQL Server did and Access didn't accept "year" as an alias (it also is a function name).
[ADDED]: one can use square brackets when there is a risk of clashing with reserved keywords, like so:
SELECT COUNT(1) as [count], datepart("yyyy", payment_date) as [year] FROM payments GROUP BY datepart("yyyy", payment_date)
[/ADDED]
Luc Pattyn [My Articles] Nil Volentibus Arduum
modified on Wednesday, August 24, 2011 12:09 AM
|
|
|
|
|
Thanks a lot for your kind answer, Luc!
Now I'll try your suggestions.
SELECT COUNT(1) as [count], datepart("yyyy", payment_date) as [year] FROM payments GROUP BY datepart("yyyy", payment_date)
work good.
But, there is a problem:
1. I would like to do something this
client | 2007 | 2008 | 2009 | 2010 | 2011 |
-----------------------------------------------------------
client_1 |1,200.78$ |267.89$ |.... |.... |..... |
-----------------------------------------------------------
client_2 |678.67$ |5,76.00$|.... |.... |..... |
means that, on each column to has a sum of all invoice from that year
Sorry for my english...
Could you help me again?
|
|
|
|
|
Have a look at this query:
select SUM([total_sales]) as [Total], [Client],year([invoice_date]) as [InvoDate]
FROM vanzari_totale
group by [client], year([invoice_date])
|
|
|
|
|
thanks for your kind post, but your solution isn't one good for me because the years appear in row not in column
3545,3 2007 client_1 1
433,33 2008 client_1 1
77756,1 2009 client_1 1
3423,7 2010 client_1 1
1234,44 2011 client_1 1
I think that the only solution is to use TRANSFORM.....PIVOT
Right? Or there is another solution?
Please let me know if is true.
Thanks a lot for your support!
|
|
|
|
|
The format you have provided for output, it seems that you want to use it in chart control? Is it right?
|
|
|
|
|
No, it's only interogate for a datagrid. I want to do this for a rapid information of sales agents about history of customer. It's a small office application...
|
|
|
|
|
LUC,
I think that the solution is:
TRANSFORM Sum(Vanzari.Valoare) AS SumOfValoare
SELECT Vanzari.Client
FROM Vanzari
GROUP BY Vanzari.Client
PIVOT Month([Data]);
and work good, this I have a column for each year and sum of invoice/year/client
|
|
|
|