Page 1 of 1 1
Topic Options
#133378 - 2005-02-04 04:54 PM Tutorial? & Open office doc w/script
LittleED Offline
Fresh Scripter

Registered: 2005-02-04
Posts: 6
I've only been working with KiXtart for about a week now, so I'm greener then grass in the spring time. I don't have a lot of programming knowledge, but I'm trying to learn.

First Question:
Is there a KiXtart tutorial I can learn from?


Second Question:
I've been reading the help file trying to learn from it. It has an example of some code that will open a Excel spreesheet and put data in it. I tried it and it worked great. So I wanted to experiment with opening a MS Word doc. Well I figured out how to get MS Word open, but when I tried to get a new doc to open, I just got errors. I would also like to know how can I open a MS Word doc that I have saved on my hard drive. Anyone have some ideas?


Here is my code. I've commented the lines that I tried and didn't work.

$oWD = CreateObject ("Word.application")

if @error = 0
$oWD.visible = 1; make Word visible to the user
;$b=Open ( 3 , "c:\kixs\LeaveRequest.doc" , 5); Open file in Word
;$rc=$oWD.Document1.new ; Open new document in Word

else
? @error + " / " @serror
endif


Thanks,
Little E

Top
#133379 - 2005-02-04 05:33 PM Re: Tutorial? & Open office doc w/script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
That really depends on what you want to do with it after you got it opened. If you want to continue to manipulate it in KiX after you opened it, then COM is the way to go but if you simply want to open it and move on, just do:
Run '%comspec% /c start c:\kixs\LeaveRequest.doc'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133380 - 2005-02-04 06:00 PM Re: Tutorial? & Open office doc w/script
LittleED Offline
Fresh Scripter

Registered: 2005-02-04
Posts: 6
Actually both. I'd like to learn both ways. Thank you for the code you sent. I tried it and it worked great!!

What if I want to open a new doc and manipulate it with KiX? Will I need to use COM to do that? If so, could you give me more info on COM? That is territory I've never traveled before.

Top
#133381 - 2005-02-05 06:46 PM Re: Tutorial? & Open office doc w/script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You'd need to study the Word COM interface which is documented on the Microsoft site. An excellent KiXtart "tutorial" is the "Start to Finish Guide to Scripting with KiXtart" at http://www.kixscripts.com/book/
_________________________
There are two types of vessels, submarines and targets.

Top
#133382 - 2005-02-06 07:01 PM Re: Tutorial? & Open office doc w/script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If I were more proficient at COM, I would give you a better answer on your code, seeing as you did such a nice job of setting up your user profile here and how nicely you formatted your first post. I hate to slam you with a STFB, but the board search is your friend. Try plugging in ("Word.application") and see what hits you get. If you don't find the answer, post back and I'm sure someone will help.

Oh.. and BTW, welcome to the board!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#133383 - 2005-02-07 12:19 AM Re: Tutorial? & Open office doc w/script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Quote:

nicely you formatted your first post



Except that code is not enclosed between [CODE] tags
_________________________
There are two types of vessels, submarines and targets.

Top
#133384 - 2005-02-07 03:42 PM Re: Tutorial? & Open office doc w/script
LittleED Offline
Fresh Scripter

Registered: 2005-02-04
Posts: 6
Thank you for the info on the book. I have looked into it and I will see what I can do about getting it. It looks like it could help me a bunch.

Thank you both for your compliments on my profile. I just followed your website instructions. If this book about KiXtart is as user friendly as your instructions, I should be able to pick up on this script stuff without any problems.

Sorry for not putting my code between [CODE] tags. I will try to do better next time.

Little E

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.097 seconds in which 0.067 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org