?
Solved

command button in ms Excell that loads a help file in ms word

Posted on 2003-02-20
8
Medium Priority
?
145 Views
Last Modified: 2010-05-01
hi there,

ive put a command button on my excel worksheet that i want to link to a help file i wrote in word,
i looked at the help file but it realy dindt help

i think i need to use this  ActivateMicrosoftApp (xlMicrosoftWord)


but cant get it to work

any ideas???


cheers

Leth
0
Comment
Question by:Leth
  • 5
  • 3
8 Comments
 
LVL 2

Expert Comment

by:NPluis
ID: 7987398
reference the word lib. then
dim objWord as Word.Application
set objWord = new Word.Application
0
 

Author Comment

by:Leth
ID: 7992205
okay that makes sense,  apart from  the reference part .
what do you mean?

the word libary?
cheers!!!
0
 

Author Comment

by:Leth
ID: 7992255
okay okay i got it to work  at last!
even mananged to work out how to point to a path

thanx!!


can i just ask do you know any where online where i will find info  to make a button that opens an outlook window and attaches the excel file to it?

thanx for any help

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Leth
ID: 8015151
Private Sub cmdsend_Click()
' This procedure is a brief sample showing
' how to automate Outlook.

' Remember to set a reference to the most current available
' Microsoft Outlook oject library.

    Dim appOutl As Outlook.Application
    Dim maiMail As MailItem
    Dim recMessage As Recipient
    Dim booRecip As Boolean
   
    ' Set a reference to the Outlook Application object.
    Set appOutl = New Outlook.Application
   
    ' Set a reference to the MailItem object.
    Set maiMail = appOutl.CreateItem(olMailItem)
   
    With maiMail
        ' Get an address from the user.
        Set recMessage = .Recipients.Add(InputBox("Enter name of message recipient", "Recipient Name"))
       
        ' Attempt to resolve the recipient against an address book.
        booRecip = recMessage.Resolve
       
        ' Add subject and body text.
        .Subject = "Testing mail by Automation"
        .Body = ActiveDocument.Content

       
        ' Send the mail.
        .Send
   
    End With
   
    ' Close object references.
    Set appOutl = Nothing
    Set maiMail = Nothing
    Set recMessage = Nothing

 End Sub


i used this code but it didnt like   this line
     .Body = ActiveDocument.Content
said there was no active document
ehhh???
0
 
LVL 2

Expert Comment

by:NPluis
ID: 8015213
You probably want it as an attachment and not in the body of the message so change the .Body part in:

 .Attachments.Add "c:\test\test.xls"

You have to save your excel sheet first in order to attach it.
0
 

Author Comment

by:Leth
ID: 8015250
okay, say i have e-mailed you the form, and you have opened it from outlook. entered the information and then clicked on the form,
the location of the file isnt going to be on my hard drive  it would be on theirs.
how would i be able to re atach that so it gets sent back

would it still be  .Attachments.add    and then something different,
there is no way of knowing what their drive would be as were all on a network, and use our id numbers as our sharted space on the network

thanx for all your help!!!
0
 
LVL 2

Accepted Solution

by:
NPluis earned 80 total points
ID: 8015353
and why not save it first then with:
Excel.ActiveWorkbook.SaveAs "c:\temp\temp.xls"

then add it:
.Attachments.Add "c:\temp\temp.xls"

0
 

Author Comment

by:Leth
ID: 8016937
as usual from this place,  another excellent answer from wonderful people who dont mind explaining easy concepts to dum people
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question