Click here to Skip to main content
15,905,683 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionBindingNavigator out of sync with filtered data Pin
Marco Beets21-Jul-08 12:32
Marco Beets21-Jul-08 12:32 
AnswerRe: BindingNavigator out of sync with filtered data Pin
Marco Beets22-Jul-08 7:56
Marco Beets22-Jul-08 7:56 
QuestionVB6 and .NET Components Pin
Tim Carmichael21-Jul-08 10:05
Tim Carmichael21-Jul-08 10:05 
AnswerRe: VB6 and .NET Components Pin
Mycroft Holmes21-Jul-08 14:32
professionalMycroft Holmes21-Jul-08 14:32 
QuestionMSMAPI32.DLL Pin
anirudhnamdeo21-Jul-08 8:46
anirudhnamdeo21-Jul-08 8:46 
AnswerRe: MSMAPI32.DLL Pin
Steven J Jowett21-Jul-08 23:14
Steven J Jowett21-Jul-08 23:14 
GeneralRe: MSMAPI32.DLL Pin
anirudhnamdeo22-Jul-08 3:45
anirudhnamdeo22-Jul-08 3:45 
QuestionReferencing, opening, and using Microsoft Word from a Windows Forms Application Pin
Steven St. John21-Jul-08 6:22
Steven St. John21-Jul-08 6:22 
First off, I'm in the "skilled hobbyist" category - I don't do this for a living and my apps are not commercial apps. However, I've distributed some of my apps to colleagues who in some cases find them very useful. My question (when I get to it) will concern: how do I make sure what works on my machine will work on their machines?

I am coding an app that is working fine for me. Its job is just to create "recipes" for mixing chemical solutions. Really it's a glorified calculator, but with time-savers like allowing you to save molecular weights of commonly-used chemicals, jumping to websites that contain chemistry databases, organizing your library of chemicals by user-defined groupings, etc.

One can just run the calculations and write down the results. But I decided to provide a way to store recipes in a log - you can run several calculations and build a document of the recipes for saving or printing. Rather than code a mini word processor, I decided I'd just have the code open Microsoft Word. Now, to questions:

In my program I declare a global variable:

Public log As Word.Application


I noticed if I declared this "as new" then Word began running in the background. So in the File... Open log even of the menu, the code is:

btnCopyToLog.Enabled = True
Try
    log.Visible = True
Catch
    Dim openit As New Word.Application
    log = openit
    log.Visible = True
    openit = Nothing
End Try
log.Documents.Add()


I'm doing it this way to get the global variable to reference the Word app. I probably will wrap this all in a Class once I have a clear vision of how it all will work. Right now, the btnCopyToLog Click event has another Try...Catch to write text to the ActiveDocument. The Form Closing event sets log to Nothing.

My question is this: it works for me. But if I send it to another person who doesn't have Microsoft Word 2003, what will happen? Will the app fail to run because there is a reference to the Microsoft Word 11.0 library? Or will the app run but throw a run-time error at the "log" variable declaration? (Is this fatal since declarations can't be error trapped?) Or will the app only throw an error when the variable is used? (In which case I can error trap it.) What if the user has a newer or older version of Word?

Thank you in advance for any guidance you can offer. I can always make my own log window with a rich text box if need be. But I'd also like to learn more about the issues involved, since I plan another program that will rely on Excel.
AnswerRe: Referencing, opening, and using Microsoft Word from a Windows Forms Application Pin
jzonthemtn21-Jul-08 7:44
jzonthemtn21-Jul-08 7:44 
GeneralRe: Referencing, opening, and using Microsoft Word from a Windows Forms Application Pin
Steven St. John21-Jul-08 8:01
Steven St. John21-Jul-08 8:01 
GeneralRe: Referencing, opening, and using Microsoft Word from a Windows Forms Application [modified] Pin
jzonthemtn21-Jul-08 8:20
jzonthemtn21-Jul-08 8:20 
AnswerRe: Referencing, opening, and using Microsoft Word from a Windows Forms Application Pin
Paul Conrad21-Jul-08 8:46
professionalPaul Conrad21-Jul-08 8:46 
AnswerRe: Referencing, opening, and using Microsoft Word from a Windows Forms Application Pin
Steven St. John21-Jul-08 9:24
Steven St. John21-Jul-08 9:24 
Questionhow to Add new task in windows task schedular Pin
~Khatri Mitesh~21-Jul-08 6:14
~Khatri Mitesh~21-Jul-08 6:14 
AnswerRe: how to Add new task in windows task schedular Pin
jzonthemtn21-Jul-08 6:34
jzonthemtn21-Jul-08 6:34 
AnswerRe: how to Add new task in windows task schedular Pin
Jon_Boy21-Jul-08 9:39
Jon_Boy21-Jul-08 9:39 
QuestionOdd question of the day: Can you have multiple font colors in same text on single statusstriplabel? Pin
Jon_Boy21-Jul-08 5:33
Jon_Boy21-Jul-08 5:33 
AnswerRe: Odd question of the day: Can you have multiple font colors in same text on single statusstriplabel? Pin
Thomas Stockwell21-Jul-08 5:37
professionalThomas Stockwell21-Jul-08 5:37 
GeneralRe: Odd question of the day: Can you have multiple font colors in same text on single statusstriplabel? Pin
Jon_Boy21-Jul-08 7:12
Jon_Boy21-Jul-08 7:12 
AnswerRe: Odd question of the day: Can you have multiple font colors in same text on single statusstriplabel? Pin
Steven J Jowett21-Jul-08 7:14
Steven J Jowett21-Jul-08 7:14 
GeneralRe: Odd question of the day: Can you have multiple font colors in same text on single statusstriplabel? [modified] Pin
Jon_Boy21-Jul-08 8:42
Jon_Boy21-Jul-08 8:42 
QuestionProblem Localhost Web Reference method (fails showing return type) Pin
edmonson21-Jul-08 2:00
edmonson21-Jul-08 2:00 
AnswerRe: Problem Localhost Web Reference method (fails showing return type) Pin
Vimalsoft(Pty) Ltd21-Jul-08 3:22
professionalVimalsoft(Pty) Ltd21-Jul-08 3:22 
GeneralProblem Localhost Web Reference method (fails generating proxy web methods. Not map DataTable object correctly) Pin
edmonson21-Jul-08 7:37
edmonson21-Jul-08 7:37 
GeneralRe: Problem Localhost Web Reference method (fails generating proxy web methods. Not map DataTable object correctly) Pin
Vimalsoft(Pty) Ltd21-Jul-08 10:01
professionalVimalsoft(Pty) Ltd21-Jul-08 10:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.