Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Morning guys and girls
 
I'm stuck between a rock and a hard place and I would appreciate any type of help.
 
I have created an .EXE to be emailed/written to cd and then given to a client off site.
 
The programme takes some values filled into textboxes by the client to perform a couple of calculations and then, in a couple of other textboxes give the client results.
 
I then export/generate a temporary office word document that contains all these textbox values, print the document and then deletes the word file. The reason is that we don't want digital copies of results available, since the client just might change the document.
 
Now this all work well on my pc as it should. I then tried it on other pcs in the office and found that some are not running the .Net 3.5 framework and has to be installed to run, this I sorted out by attaching the .Net 3.5 framework to the cd or email to the client.
 
Then I got another error... This makes reference to 'Microsoft.Office.Interop.Word' which I understand to be a serial number/version number problem blah blah blah. I have read that you can download the fix for this but the thing is I don't want the client to download "10" fixes before they can use the programme, it must be open, use, print, close, done.
 
What else can I do to export information to a document containing graphics like logos etc, print the document and then delete?
Posted 7-Feb-13 1:26am
Comments
VitorHugoGarcia at 7-Feb-13 6:36am
   
Instead of working with MS Word, could you produce a PDF file ?
JacquesGrobler at 7-Feb-13 6:40am
   
I can have a pdf, but if the client only has a "pdf printer", can this still be done? It doens't matter what means, as long as it works and as long as the client doesn't require any additonal software to operate the programme.
 
Then the next question is, can .Net alter an existing pdf?
VitorHugoGarcia at 7-Feb-13 7:10am
   
You can create a PDF file from scratch. Take a look here http://www.codeproject.com/Questions/160004/how-to-create-pdf-file-in-vb-net
CHill60 at 7-Feb-13 6:41am
   
Could you produce an RTF file?
JacquesGrobler at 7-Feb-13 6:44am
   
What is an RTF file? Can it incorporate company logos, other text than what is in the exe?
CHill60 at 7-Feb-13 6:46am
   
RTF = Rich Text Format. I believe it can hold logos ... check out the use of RichTextBox control
CHill60 at 7-Feb-13 6:50am
   
Just found this which might help http://stackoverflow.com/questions/1490734/programatically-adding-images-to-rtf-document
JacquesGrobler at 7-Feb-13 6:52am
   
Thanks Chill
 
Having a look now, will let you know.
JacquesGrobler at 7-Feb-13 7:06am
   
Do you perhaps have an example of how this works as I have never seen this before?
CHill60 at 7-Feb-13 8:27am
   
Found it! Not surprisingly somewhere in CodeProject :-) Have a look at this link http://www.codeproject.com/Articles/98062/RTF-Document-Constructor-Library -
There is also a specific question with another code snippet in the comments afterwards - a long way down though! The code is in C# but there are plenty of conversion tools around (e.g. http://www.developerfusion.com/tools/convert/csharp-to-vb/)
Mike Meinz at 7-Feb-13 9:39am
   
This solves the version issue for the Word InterOp Assembly in Visual Studio 2012.
 
After you Add the Reference to Microsoft.Office.InterOp.Word in your project, select Microsoft.Office.InterOp.Word in the list of added references and then click Properties. In the Properties dialog, change Specific Version to False.
JacquesGrobler at 8-Feb-13 2:04am
   
Hi Mike
 
I can't see the option to change the version under the properties dialog
JacquesGrobler at 8-Feb-13 2:44am
   
Sorry, I see that I can do this in VS 2012, I unfortunately run 2008
CHill60 at 7-Feb-13 11:12am
   
Also found this http://www.codeproject.com/Articles/10999/Printing-Word-Documents-in-C - where the chap has tried to make it non-version specific by using .PrintOutOld

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 230
1 PIEBALDconsult 150
2 DamithSL 125
3 Andreas Gieriet 90
4 Jochen Arndt 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 3 Aug 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100