|
|
Comments and Discussions
|
|
 |

|
I need to copy selected contents in word doc to excel sheet. What should i do?
|
|
|
|

|
I need to copy the selected contents in word doc to an excel Sheet. What should i do?
|
|
|
|

|
Your article is most useful.
I have a problem. When I insert texts in a word document (word automation), how I can retrieve information on current line? Which number line I have reached?
Might be usef retrieve information from status bar. You know how do it?
Bye
|
|
|
|

|
this is a great article to get started, now how does one find further, more detailed information on this, like how to change the colour of the text using ativeX, create tables etc.?
|
|
|
|

|
Hi,
you can find all the info you need in MSDN Office Development site.
Hope it helps,
- Dmitry.
P.S. If it won't bother you, can you please vote for the article? Thank you very much in advance!
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|

|
I've voted for the article.
the MSDN Office Development is a huge document,exactly where would I look
on this site?
Kim
|
|
|
|

|
kimwong wrote: I've voted for the article.
Thank you very much!
kimwong wrote: the MSDN Office Development is a huge document,exactly where would I look on this site?
On the main page of MSDN Office Development, on the right there is a menu: Products and Technologies. There you'll select the product you with to script for (Word, Excel, Access...). This will lead you to the product's home page - for example, to the Word Developer Portal. Again, on the right is the menu with a Wrod product line - select one that fits (Word 2007 for instance).
On that final page, look at the References section. That's where you should look.
- Dmitry.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|

|
Nice article, I just wanted to point out 2 things.
1. Error handling - it is sometimes a good idea to add this into the code as Word could behave erratic across different system setups or between different versions of Word. When Word throws an unanticipated error, you could be left with a Word object that hasn't been disposed, etc.
Using a try/catch block on a possibly finicky line of code is the best safety precaution:
try{
//normal code here
}catch(err){
//error handling & cleanup routines here
}
2. Additional navigation methods - you can also use (1) the Find feature of Word within the Selection object to navigate the document, as well as (2) the hyperlink follow feature:
//WordObj.Selection.Find.Execute("text",case-sensitivity,...);
WordObj.Selection.Find.Execute("text");
if(WordObj.Selection.Find.Found){
//cursor now at start of found text, do something
}else{
//no change in cursor position
WScript.Echo("Failed to find the text in the document.");
}
//or after finding a document hyperlink in word
WordObj.Selection.Hyperlinks(1).Follow();
//this will bring you to the beginning of the hyperlinked source
|
|
|
|

|
Another great Office article today. I don't think WSH get's enough love. It's really very useful and I've written entire utility apps in it. I especially like how I can code in a JavaScript-looking language. A guy needs a break from VB every know and again, eh?
|
|
|
|

|
JohnDeHope3 wrote: I don't think WSH get's enough love. It's really very useful and I've written entire utility apps in it. I especially like how I can code in a JavaScript-looking language. A guy needs a break from VB every know and again, eh?
Indeed. What's great about Javascript + WSH is that you get to use try/catch error handling. With VBScript (unlike VBA or VB), you only get "On Error Resume Next" combined with "If Err.Number <> 0 Then" to check for errors and that's kind of limited. Furthermore, you won't be able to catch errors from say the Word object with this VBScript technique since the object is separate from or outside of the runtime. But javascript can catch it via try/catch.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Learn how to integrate MS Word functionality with your JScript/WSH scripting solutions.
| Type | Article |
| Licence | |
| First Posted | 5 Jan 2006 |
| Views | 52,604 |
| Bookmarked | 35 times |
|
|