|
I m new to office addin in VS 2008.
I am creating a word template in VS 2008 now i also created a ribbon button. what i want is when i click the ribbon button it should read xml file and fill the data in the template in which there is a table.
i am reading the file on the click of a button but i am not able to access the word template table in which i want to add the data since both are seperate projects (addin project and template project)
i also used the Microsoft.Office.Interop library to access the word object but i am not able to access the table object through which i want to insert the data in the xml file into the table.
any one has an idea on how to do it?
|
|
|
|
|
Hello Friends,
I have generated problem while generating Print priview (When i m printing 4000-50000 Pages).
Error is Given Below
Screen-compatible bitmap cannot be created. The screen bitmap format cannot be determined.
Actually the problem is generated by this line
Me.PrintDocument1.DefaultPageSettings.HardMarginX
In 4900 times it's working normally. But at 4913 it generates error Attempted to divide by zero.
so plese give me the solution for that.
Thanks
If you can think then I Can.
modified on Monday, November 2, 2009 1:43 AM
|
|
|
|
|
eg_Anubhava wrote: Me.PrintDocument1.DefaultPageSettings.HardMarginX
That can't be the whole line, it doesn't do anything. What's the rest of it ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The Proper Line is
If (leftMargin - Me.PrintDocument1.DefaultPageSettings.HardMarginX) >= 0.0F Then
'Code here
end if
If you can think then I Can.
|
|
|
|
|
OK, then I guess HardMarginX must internally do some sort of division. Perhaps you need to work out what that is, with reflection, and replace it with your own code which first checks for zero ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Can u explain it.
If you can think then I Can.
|
|
|
|
|
Not sure how to make it simpler. If you get a divide by zero exception, that property must, inside .NET, do a divide by a value that's getting set to zero. Use reflektor or similar to find out what the source code for that property is, and instead of accessing that property, write your own that checks the values it uses, but first makes sure the value being divided by is not zero, and if it is, find a way to deal with that.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am making codoing changes to my Visual Basic.Net project but when I execute the code using the debugger, I see the old code. I added a new button to a form but when I execute the code, the button is not there. It seems like the code is executing from a different library.
Any suggestions?
|
|
|
|
|
Change your settings to run the debug version.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You may also want to Clean the solution and recompile.
|
|
|
|
|
Dear All,
I have two column in a datagridview, A,B. I want to implement the following :
1) search "x" in column A
2) get the corresponding row number
3) goto the same row number in column B
4) get the corresponding entry in B.
Can someone pls help me with a piece of code?
Regards
R.
|
|
|
|
|
Something like:
Public Function GetGridData(ByVal value as Object) As Object
For Each dr as DAtaGridViewRow In dgv.Rows
If dr(0).Cells.Value = value Then
Return dr(1).Cells.Value
End If
Next
End Function
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Thanks Andy. But one thing, If My number of rows are 5000, then will this search be fast?
Because I have to run this search 2-3 times in my complete project.
|
|
|
|
|
hi,
i have a textbox and i want to copy the contents of the textbox into a .txt file.
my current code works however when i open the .txt file it comes up saying
"System.Windows.Forms.TextBox, Text:" then what i actually want in the .txt file
is there any way where i can stop this from happening and just displaying what i want in the text box in the .txt file?
code used
objWriter.WriteLine(TextBox1)
objWriter.Close()
many thanks
|
|
|
|
|
offroaderdan wrote: objWriter.WriteLine(TextBox1)
Can you see anything wrong here? You aren't writing the text to file.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
at the beggining i have
dim serial as string = ("TEST.txt")
|
|
|
|
|
Doesn't the TextBox1 object you have expose a Text property??
Seriously...pick up a beginners book on VB.NET. You're showing us you don't understand the basics of the language, the basic .NET object model, and a bunch of other stuff that makes it very difficult for you to understand the answers you're getting. This is just another example of it.
|
|
|
|
|
Hi,
File open from Office Automation, is it possible to dock the word document inside the panel4?
Dim mf As Microsoft.Office.Interop.Word.Application
mf.Documents.Open("C:\Sample\My_Exp.doc")
blah...blah...blah....
mf.visible =true
??????????????
Thanks
|
|
|
|
|
|
Hi Dave,
Anyhow many of your guidences are more powerful and helped me at right moments. Atleast I can say THANKS here, and I will pray for your piece.You have to live good.
|
|
|
|
|
There is a article here on CP in C#, WinWordControl[^] that you could use as a basis for converting to your needs.
|
|
|
|
|
hello,
my last question was basically on the lines of how do i use the command prompt in vb.net to recieve information. I want to try and get the serial number of command prompt (wmic bios get serialnumber - in command prompt) this will then bring up a serial number
someone answered my question with a line of code that proably does work however ia m having trouble incorprating it to do what i want it to do. I want to copy the serial number fro the command prompt into a text box?
here is my code
Imports System.Management
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SerialNumber As System.Management.ManagementClass
Dim Win32_BIOS As System.Management.ManagementObjectSearcher
Select Case SerialNumber FROM Win32_BIOS ' surely FROM should be in blue???
End Select
textbox1.text = SerialNumber 'copys serial number from the Win32_bios into the txtdocument
End Sub
End Class
i am a bit of a beginner/intermediate but it would really mean allot if i could get this working
many thanks
|
|
|
|
|
offroaderdan wrote: Select Case SerialNumber FROM Win32_BIOS
Oh no. It takes a bit more code. I only have a C# example showing all non-null entries in Win32_BIOS:
ManagementObjectSearcher searcher=
new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");
ManagementObjectCollection results=searcher.Get();
foreach (ManagementObject result in results) {
PropertyDataCollection pdc=result.Properties;
foreach (PropertyData pd in pdc) {
string name=pd.Name;
object obj=pd.Value;
if (obj!=null) output(name+" = \""+obj.ToString()+"\"");
}
}
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
thanks for the reply!!!
Umm i've had ago at trying to write what you put n c into vb.net however i have no idea what code to use?
as i have only ever coded in vb.net
Where do i use the
Select Case SerialNumber FROM Win32_BIOS ' surely FROM should be in blue???
End Select
??
Many thanks
|
|
|
|
|
in the ManagementObjectSearcher constructor, as I did.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|