WORD OLE automation
The following code works perfectly with WORD6/Windows95/PB6, but does
not work for WORD 97/NT.
OLEObject lole_word
string ls_mytext = "Trial text"
li_rc = lole_word = CREATE OLEObject
li_rc = lole_word.ConnectToNewObject("word.basic") // in
NT WORD is opened INVISIBLY
// It appears as a process in the Task Manager
// li_rc = 0
li_rc = lole_word.FileNew("normal",
0) // Returns li_rc = NULL
li_rc =
lole_word.Insert(ls_mytext)
// Not recognised by WORD97
li_rc =
...
OLE and MS WordHello,
I'm looking for a simple application that creates a Word document (*.doc)
and writes some text there without opening Word and then closes the
connection to that OLE object...
Thanks in advance...
Have you tried looking at
http://www.sybase.com/detail?id=47980
Just a hint. You can search the Sybase tech docs from
http://www.sybase.com/support/techdocs
Good luck,
Terry [TeamSybase] and Sequel the techno-kitten
On 3 Feb 2004 02:40:13 -0800, "Piotr Nadolny" <pnad@o2.pl> wrote:
>I'm looking for a simple application that creates ...
OLE with MS WordHello all,
Where can I find a list of Active X commands to control MS word.
I'm trying to do: ole_1.Object.SaveAs("c:\test.doc") but "Save As HTML"
instead.
I would like to find a list of all the commands to carry out various
functions.
Thanks for reading!
Rick
This is all wriiten down in the Office developers books. Best place to
search on the internet is http://msdn.microsoft.com
HTH
--
- Eric Aling [TeamSybase], Avalix Information Systems, The Netherlands
Eric's Home & PB Site @ http://www.knoware.nl/users/cypr115
...
Ole to Word 95 (Word 7)I am trying to get Word to retrieve a document and come into focus.
The ConnectToObject is working fine. The retrieve is working fine. The
only problem that I am having is getting Word to pop-up if it is
currently minimized. If it is not minimized, a AppActivate() command
works fine. I have tried AppMaximize(),AppShow() and AppRestore(). If
Word is minimized, none of these work. Anyone have any ideas ??
Kevin Wydra
kwydra@magicnet.net
I use API functions like Showwindow()
Kevin Wydra wrote:
> I am trying to get Word to retrieve a document and come into focu...
Word 6.0 and Word 97 installedWe have two versions of MS Word installed, Word 6.0 and Word 97. We
have all the OLE control objects and commands written for Word 6.0. We
are not ready to code for Word 97 yet. We have users that need both
version of Word installed. How do we point to Word 6.0 OLE object when
we have Word 6.0 and Word 97 installed? Is there a way we can modify
the registry entry to point to Word 6.0? Right now, everything is
pointing to Word 97. When I create a OLE word object on the window, it
points to Word 97.
Thanks,
Lynn
...
Migrating OLE from Word 95 to Word 2000I've spent the last week and half looking up syntax in Word's VBA help file and
trying to get it to work in a very large PB 6.5.1 program. Today I stumbled upon
a document at http://support.microsoft.com/support/kb/articles/Q232/4/65.ASP
I hope I'm wrong, but I get the impression from reading the text and looking at
the code examples, that pretty much all you have to do to migrate is to insert
the VBA keyword WordBasic in our PB ole code.
For instance,
ole_contact_ltr.FilePrintSetup(ls_printer_name, 0) <== Works with Word 95
ole_contact_ltr.WordBasic.FilePrintSet...
OLE Word Crash with non-Word blobI am using an OLE control with word and reading/storing the data as a blob
in an oracle database. I allow the user to initially populate the blob with
a GetFileOpenName(). Everything works fine as long as the users select a
valid word file. If they select something else, such as a text file, when I
load the blob with the
this.ObjectData = lbl_document
statement, I get a "Bad runtime function reference " at that line.
Is there any way to more gracefully capture this error?
Thanks in advance,
Scott Ewine
If you're on PB8 or later, use structured excepti...
OLE (MS-Word) ControlHi everybody! I hope I say this all correctly, cause I have only about 6
months experience with PowerBuilder.
I'm using version 6.5.1 of PowerBuilder...
I have a datawindow where I have placed an OLE control (an MS-Word doc built
in Office 97) in the detail band of the datawindow. The Word document is
"linked" not "imbeded". The idea is to merge some addresses (Sybase
columns) with the Word doc and print it.
All of that works great, however once I print the datawindow (using
PFC_PRINT), my mouse will appear normal, but clicking on anything, anywhere
in...
OLE, MS Word, PBI want to use OLE control to display an existing MS word document inside a
powerbuilder response window. I used ole_1.InsertFile(filename) and
displayasactivexdocument!, I can see the document, but the word's toolbar,
menu, status bar all being displayed. How do I hide them but still have
scrollbars? If I define as displayascontent!, the document has very small
font, no scrollbars, and it is not readable. Please advice how to do this.
I do not need to edit nor save the document.
Dear "Joy"!
There is some way to hide all the commandbars in word ( when ole-c...
OLE (MS-Word) ControlHi everybody! I hope I say this all correctly, cause I have only about 6
months experience with PowerBuilder.
I'm using version 6.5.1 of PowerBuilder...
I have a datawindow where I have placed an OLE control (an MS-Word doc built
in Office 97) in the detail band of the datawindow. The Word document is
"linked" not "imbeded". The idea is to merge some addresses (Sybase
columns) with the Word doc and print it.
All of that works great, however once I print the datawindow (using
PFC_PRINT), my mouse will appear normal, but clicking on anything, anywhere
in...
OLE to MS Word for SpellcheckingI'm starting an OLE instance of Word (version 10) to take advantage of it's
spell checking feature. This works fine except for when I ADD a new
document to Word. The ADD function wants to be visible by default. We
don't want the user to see anything except the Checkspelling dialog if it
finds and word in question. I've searched around and found that there are
some parameters for the ADD statement. In fact, the fourth paramater is the
visibility value. I've been trying various combinations of passing
parameters or a parameter string through my OLE object to Word...
WDK and MS-Word through OLEHi,
I am doing OLE to MS-Word to generate some letters. WDK gives an error
message 'File Not found' when executing 'LinkTo()' function. But the
file does exists in the specified path. Could anybody suggest a work
around?
Here is the code:
ls_doc_name = "c:\charts\cse0007.doc"
// check whether the document is existing
lb_fileexists = FileExists(ls_doc_name)
CHOOSE CASE lb_fileexists
CASE FALSE
MessageBox("Error", ls_doc_name + " Not found",StopSign!)
Return FALSE
END CHOOSE
//ole_docword is an OLE control with Object Type ...
Close Word thru OleHi PB gurus.
I need your help.
I have opened an OLE Session. I open the Word, put somethings inside
, save the document. Now I need to close the Word application.
How could I handle this?
Thanks.
Carlos
Try the following:
(aole is an OLE control)
aole.object.quit(0) //Quit and close documents without saving
carlosf wrote:
> Hi PB gurus.
>
> I need your help.
>
> I have opened an OLE Session. I open the Word, put somethings inside
> , save the document. Now I need to close the Word application.
> How could I handle this?
>
...
PBHelo,
I have following problem. I want only to write some data read from DB in PB
to a Word docment and then to print it out. I am using OLE - everything is
OK - I am connected to MS Word, the file is opened, I can even print it
...., but I can't manage to write on a bookmark. I have already tried
following, but nothing works:
ole_word.object.Application.ActiveDocument.Bookmarks("testbook").Range.Text
= "test value"
Since I know that there can be troubles with bookmarks (defined x
notdefined) in Word I thought that maybe it could be better to use the
boo...