|
Hi,
How can I start VBA IDE Editor Like in Access or enother MS Office
applications?
Thanks.
Oleg
|
|
|
|
|
I have a project with COM and I'm using MSOffice XP, My compiler can find mso9.dll. Can anyone help me ? Thank very much. I have to finish my project in this week.;)
|
|
|
|
|
Office XP uses MSO.DLL, MSO9.dll is for Office 2000.
Michael
|
|
|
|
|
Hi,
I've had this problem too. The solution was for me to unregister the OLE interface when the acces to the interface was over. In order to kill the application you must call the CoUnInitialize() (or UnInitialize()) function and the trick is done.
To assure a complete uninitialisation you must call the Quit member fuction of the interface when it exists
(m_ctrl->Quit()) and you also must release the smart pointer by calling m_ctrl.release().
By doing this you will see that the application is not memory resident anymore.
Have fun !
Take it by hour, not by heart !
|
|
|
|
|
Add the following code at OnDestroy() of CXOfficeView.
CXOfficeDoc * pDoc = GetDocument();
pDoc->m_ctrl->Release();
|
|
|
|
|
Add the following code at OnDestroy() of CXOfficeView.
CXOfficeDoc * pDoc = GetDocument();
pDoc->m_ctrl->Release();
no effect and EXCEL.exe have not quit.
now how i want to release office resource.
|
|
|
|
|
I have office 2000 installed on my computer, when i tried to compile the project i had error at the line:
_CommandBarsPtr CommandBars;
can anyone help me with this
thanx
|
|
|
|
|
I have encountered a similar problem in the tli/tlh files with Office 2000.
What happened in my case is that when '#importing' the vbeext1.olb file, it xrefs to the mso97.dll (from Office 97), rather than the mso9.dll (from office 2000).
I suspect this is because I installed Access 97 after installing Office 2000.
Resolution :
1. I just renamed mso9.dll to be mso97.dll -- in my case I can get away with this.
2. Better idea is to reinstall Office 2000, perhaps.
|
|
|
|
|
I have encountered a similar problem in the tli/tlh files with Office 2000.
What happened in my case is that when '#importing' the vbeext1.olb file, it xrefs to the mso97.dll (from Office 97), rather than the mso9.dll (from office 2000).
I suspect this is because I installed Access 97 after installing Office 2000.
Confirmation :
Look at the line 'Cross Referenced Type Files' in the generated .tlh files to confirm this guess.
Resolution :
1. I just renamed mso9.dll to be mso97.dll -- in my case I can get away with this.
2. Better idea is to reinstall Office 2000, perhaps.
|
|
|
|
|
Delete all file of extention name that is *.tlh, *.tli in directory and subdirectory
and Recompile!!!
Errors disappear.
|
|
|
|
|
The previous message is correct. Copy MSO9.DLL from the office directory (usually C:\Program Files\Microsoft Office\Office) and rename it MSO97.DLL.
Deleting the type library (*.tlh and *tli) is not a bad idea, too. A 'rebuild all' would also be a good idea.
Many project, many years, many tears...
|
|
|
|
|
The previous message is correct. Copy MSO9.DLL from the office directory (usually C:\Program Files\Microsoft Office\Office) and rename it MSO97.DLL.
Deleting the type library (*.tlh and *tli) is not a bad idea, too. A 'rebuild all' would also be a good idea.
Many projects, many years, many tears...
|
|
|
|
|
_CommandBarsPtr Defined in mso.tlh(mso9.tlh),
but it is include in "Office" namespace,
before you import,use like this:
#import "C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL"
using namespace Office;
#import "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB"
#import "C:\Program Files\Microsoft Office\OFFICE11\MSWORD.OLB" \
rename("ExitWindows","_ExitWindows")
|
|
|
|
|
hi,
I found the article it was very helpful.
I'm developing a tailored program, based on word2000.
It's an SDI program with an embedded document.
It's no problem to operate all of the commands (including My own macros)
beside of the File menu.
at first it didn't appear, so I edited a word template with a custom menu called "File" and just put all of the operations I need there (save, save as, versions, new, open).
in runtime they all appear grayed.
when I try running a VBA Macro that calls save, I get an ambigious message.
can anyone help me out there?
Thank you,
Omri
|
|
|
|
|
Is it possible to integrate AutoCAD into my App this way?
Where can I get relevant information?
Thanks.
Lirong;)
|
|
|
|
|
If AytoCAD supports ActiveX Document technology it's possible.
|
|
|
|
|
Hi,
You did a good job.
I would like to automate Word97 and Word2000 in VC++6.0.
Because i have word2000 installed on my computer, I try to copy the files MSO97.DLL, VBEEXT1.OLB and MSWORD8.OLB to a directory of my project, and i add #import for these files in stdafx.h.
But when compiling, i have error messages (_CommandBarPtr is unknown).
My code looks like that :
#pragma warning (disable:4146)
#pragma warning (disable:4786)
#import "INTERFACE\PRINT\REFERENCE\MSO97.DLL" no_namespace
#import "INTERFACE\PRINT\REFERENCE\VBEEXT1.OLB" no_namespace
#import "INTERFACE\PRINT\REFERENCE\MSWORD8.OLB" rename("ExitWindows", "ExitWindowsWD")
#pragma warning (default:4786)
#pragma warning (default:4146)
Have you any idea about this ??
Thank you
Jean-Yves
|
|
|
|
|
I guess then compiler reads type library and this type library has link to other type library compiler tries to find last one using registry. So, compiler will use MS Office 2000 type libraries
I had these problems and currently I use MS Office 2000, but I do not use new its features and my programms work correctly with both 97 and 2000 versions.
Happy coding,
Igor
|
|
|
|
|
I'm having problem with loading my original menu after closing an embeden Exceldocument. I have tried to load all the menus again but it doesn't seem to work.
Is there anyone with a solution to this problem?
/David
|
|
|
|
|
I cant put the excel chart anywhere except for the first page. Does anyone know who to switch from page to page. Any help will be appreciated. Thanx in advance.
DrunkerII
|
|
|
|
|
Hi,
First of all, I would like to say that You made a really great Job!!!
I'm trying to make the program automated. For that, I would like to import all changes
of the Word or Excel documents in the dialogue window, so that it could go back and forth depending
on if you want to write (or save something) in the Word/Excel Docs or display the changes you
made in that ones.
Could somebody help me???
Cheers,
Thierry
|
|
|
|
|
I created a Marco in MSWORD including such code:
Application.PrintOut Background:=True, Append:=False, Range:=wdPrintFromTo, OutputFileName:="c:\tmp\word.prn", From:="1", To:="3", _
Item:=wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, PrintToFile:=True, _
Collate:=True, FileName:="", ActivePrinterMacGX:="", ManualDuplexPrint:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
It's all right.
I created a simple VB project, there's a button associated with such code:
Dim wrd As Object
Dim doc As Object
Set wrd = CreateObject("Word.Application")
Set doc = wrd.documents.open("c:\tmp\word.doc")
wrd.PrintOut True, False, 3, "c:\tmp\word.prn", "1", "3", 0, 1, "", 0, True, True, "", False, 0, 0, 0, 0
Set wrd = Nothing
A "Mismatch type" run-time error was occured(VC++ project too). Why?
|
|
|
|
|
If your code starts a Office application instance itself, you should invoke the Quit method of the Application object manually.
Dandy Cheung
|
|
|
|
|
Thank you for comment.
Unfortunately, I don't know how my application starts the Office because it uses OleCreateFromFile function. I know about this problem and then I wrote this article I tried to call Quit method, but it does not work. It seems to me that the problem is bound up with ActiveX Document Mode. In standard mode it works correctly.
Regards,
Igor.
|
|
|
|
|
Thanks alot for a great artical, one question how can use the menu from MSWORD inside my app, MSWORD starts and the save and save as and open menus are grayed out, how can I activate them so I can use them.
Thanks
|
|
|
|