Click here to Skip to main content
15,890,123 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
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 
The JZ - That link you gave on the Registry function was very helpful!
Paul Conrad - The info you gave me was just what I was looking for, with the bonus info that a Word 2007 user would also be able to run things.

So, this should work:

Public Class SolutionLog
    Dim log As Word.Application
    Dim m_WordVer As String
    Dim m_CanUseWord As Boolean

    Public Sub New()
        Dim regKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot
        Dim regWord As Microsoft.Win32.RegistryKey = regKey.OpenSubKey("Word.Application")
        If Not (regWord) Is Nothing Then
            Dim regWordVer As Microsoft.Win32.RegistryKey = regWord.OpenSubKey("CurVer")
            m_WordVer = regWordVer.GetValue("")
            If m_WordVer = "Word.Application.11" Then m_CanUseWord = True
        Else
            m_WordVer = "Word Not Installed"
            m_CanUseWord = False
        End If
    End Sub


When my program creates an instance of the SolutionLog class upon loading, the registry is checked and m_CanUseWord is set if and only if Word is found and uses Version 11 (I'll add Version 12 to this eventually, and possibly parse the string and use a >= logic). I'll make this value and the m_WordVer value available to the client program as ReadOnly properties. The methods that start Word and type to Word can be error trapped:

If Not(m_CanUseWord) Then
    Throw New Exception
Else
    log=New Word.Application
End If


The only reason it might not work is the first line:

Dim log As Word.Application


Does that cause an error? Or will it be okay since I never actually create a new Word.Application except in an error-trapped if... then? Since the code is already compiled when it gets to the user's machine, I'm assuming this will not cause an error and my problem is solved.

If I'm Right Then
   Thank you all very much!
Else
   There must be some way to do this
End If
Smile | :)
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 
GeneralProblem Solved but not real cause found Pin
edmonson22-Jul-08 0:33
edmonson22-Jul-08 0:33 
GeneralRe: Problem Solved but not real cause found Pin
Vimalsoft(Pty) Ltd22-Jul-08 1:01
professionalVimalsoft(Pty) Ltd22-Jul-08 1:01 
GeneralRe: Problem Solved but not real cause found Pin
edmonson22-Jul-08 1:06
edmonson22-Jul-08 1:06 
GeneralRe: Problem Solved but not real cause found Pin
Vimalsoft(Pty) Ltd22-Jul-08 1:11
professionalVimalsoft(Pty) Ltd22-Jul-08 1:11 
QuestionGet value from child to parent window Pin
hemant.kaushal21-Jul-08 0:53
hemant.kaushal21-Jul-08 0:53 

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.