|
Auto populate a word document with Visual studio 2003
I am using Visual studio 2003
MSSQL Server 2003
I would like to know if there are any articles out there
that shows
1. how to auto populate a word document with db fields
such as Last name, first name, phone
2. How to view the document on the web page
3. Print the document from the web page
|
|
|
|
|
This is what you need...
http://msdn2.microsoft.com/en-us/library/5s12ew2x(en-US,VS.80).aspx[^]
- or -
If you have Office 2003 installed, do this:
1. Add Remove Programs -> MS Office -> Change
2. Click on "Add Remove Features"
3. Click Next
4. Check the box next to "Choose Advanced Customization of Applications"
5. Expand each Tree Node next to the application you want and make sure ".NET Programibility Support" is included in your installed components.
This will install the "Office 2003 Primary Interop Assemblies"
Access, Word, Excel, Outlook, Powerpoint and Publisher all have exposed assemblies.
(I just did a lot of work with this for an Outlook project I did)
Matthew Hazlett
Sometimes I miss the simpler DOS days of Borland Turbo Pascal (but not very often).
-- modified at 12:53 Friday 27th January, 2006
|
|
|
|
|
Thanks I did as you said. Now I have done above do you know of any paper or tutorial that will explain how to autopopulate the word document and view it with the web page?
|
|
|
|
|
Did you look at the webpage, it has all the info you need.
This link takes you to some basic examples of using word documents.
http://msdn2.microsoft.com/en-us/library/78whx7s6.aspx[^]
Matthew Hazlett
Sometimes I miss the simpler DOS days of Borland Turbo Pascal (but not very often).
|
|
|
|
|
Thanks, I will go there now
|
|
|
|
|
Hi, now I have a sequence of bitmaps, I am wanting to put those into an AVI stream.
I have read about avifil32.dll but cant find it or any useful examples for .NET 1.1. And wasnt that impressed with Windows Media SDK. As I dont need all those other functions.
Images will be taken maybe 2 - 10 times a second.
Can anyone tell me or link me up to how to use and set up avifile32?
thanks,
Brian
|
|
|
|
|
|
ah, I should have mentioned it in my first post, I seen how to use the library in those ones, but dont know how to convert those parts, pointers or IntPtr to the VB version... maybe I can find a C# to VB converter?
|
|
|
|
|
To show where I need to start from:
where do i find avifil32?
I try:
Declare Function AVIFileInit Lib "avifil32.dll" Alias "AVIFileInit" ()<br />
'or<br />
Declare Function AVIFileInit Lib "avifil32.dll" Alias "AVIFileInit" ()<br />
'and later call<br />
AVIFileInit()
but that crashes and gives;
An unhandled exception of type 'System.Runtime.InteropServices.MarshalDirectiveException' occurred in WindowsApplication2.exe
Additional information: PInvoke restriction: can not return variants.
How to do this basic thing? thanks
|
|
|
|
|
<br />
Declare Sub AVIFileInit Lib "avifil32" ()<br />
|
|
|
|
|
Here's an idea.
Instead of converting the C# code to VB, create a C# "Class Library" project in your solution. You can then add the C# avi library wrapper to your C# class library and use it from your VB code.
|
|
|
|
|
Dear all
I had installed new visual studio.net 2005 into my PC and I have tried to open my old program which was I made under visual studio.net 2003, everything was running well until I tried to run my report form which was connected to my report form made under crystal report sheet.
I couldn't run selectionformula, to present all my data from my database to my report sheet as I wanted. Here is I treid to give you a small part of my program
I have a textbox1 in my form which is I will use as my parameter to order crystalreport to present data as I need base on the contains of that textbox1. and the list of my program are :
If textbox1.text="ALL" then
crinv.SelectionFormula= ""
crinv.RefreshReport()
Else
crinv.SelectionFormula="{inventory.invcod)='" & Me.textbox1.Text & "'"
crinv.RefreshReport()
Endif
I can get all data from my data base if I type "ALL" into Textbox and I can get the data base on inventroy code which I typed on textbox1 as well when I still use Visual studio 2003, but now I could not get any data with the same command under visual studio 2005. My question is
Could you please to give me information how to use the right SelectionFormula command in Visual studio.Net 2005, that I can present all information from my database ?
I do hope you will understand what I mean with my poor english. Thank you for your attention
Best regards
ICE
|
|
|
|
|
Swiss Mantoro wrote: crinv.SelectionFormula="{inventory.invcod)='" & Me.textbox1.Text & "'"
I noticed that your string doesn't end with a curly bracket "}". Perhaps that's why it fails?
|
|
|
|
|
Thank you for your reply but actually I used the curly bracket in my real program, but for this line program was not problem, I just concern to program line which tell, crinv.selectionFormula="".
In my previous visual studio.net version whole those program was running well, but I have no Idea why it doesn't running in version of 2005.
Thank you
ICE
|
|
|
|
|
|
Hi there,
can anyone tell me how can i load the Package and Deployment Wizard in the Add-in Manager in VB.net?
This is to create an setup.
Thanks
|
|
|
|
|
I have the same problem!I pass to VB.net recently and i don´t know how to use the add-in manager!
In VB 6 it wasvery simply.
|
|
|
|
|
Hi every1, does anyone know if it is possible to capture an image of a form that is behind another form or window?
If this is possible I later want to turn it into video capture of the selected window.
TIA,
Brian
|
|
|
|
|
You want to capture video of a window, which is not visible ?
No - a window that is not visible is not being painted, so there's nothing to capture.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for fast reply.
Then is there some way to paint this to a 'magical' spot that cant be seen and take the image capture from their?
thanks.
|
|
|
|
|
I dunno what would happen if you moved the window outside the bounds of the screen, but it would be a failure on the part of windows if it was painted there. I very much doubt it's easily achieved. If you could pass a DC to the paint event of the control, perhaps it would draw on it, but that would only be the client area, and it's just an idea, I dunno if it would work.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi again, fast response good. This solution seems to work:
<br />
Private Declare Function PrintWindow Lib "user32.dll" (ByVal _<br />
hwnd As IntPtr, ByVal hdcBlt As IntPtr, ByVal nFlags As _<br />
UInt32) As Boolean<br />
Dim screenGrab As Bitmap<br />
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click<br />
Me.SendToBack()<br />
screenGrab = New Bitmap(Me.Width, Me.Height)<br />
Dim g As Graphics = Graphics.FromImage(screenGrab)<br />
Dim hdc As IntPtr = g.GetHdc<br />
Me.PrintWindow(Me.Handle, hdc, Nothing)<br />
g.ReleaseHdc(hdc)<br />
g.Flush()<br />
g.Dispose()<br />
screenGrab.Save("C:\please.bmp", System.Drawing.Imaging.ImageFormat.Bmp)<br />
End Sub<br />
havent tested if thouroughly, but seems ok, howd anyone else run this?
|
|
|
|
|
OK - looks like the Windows API exposes this ability ( to force a paint event ). Cool.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Here is another method.
If you're using .NET 2.0, then you can call the new Form.DrawToBitmap() function.
|
|
|
|
|
thanks for another response, unfortunately cant test this out on .net 1.0.
How would I convert the previous code to remove the Title bar from that captures?
|
|
|
|