Jump to content
Sign in to follow this  
deviprasad

How to write few text in a word document

Recommended Posts

deviprasad

Here is the scenario,

my variable is holding the value what i am going to write in word document, wha i need  to do it.please suggest

Share this post


Link to post
Share on other sites
TheSaint

I haven't used it, but there is a Word Management section in the UDF (User Defined Functions) Reference of the Help file.

Bound to be plenty of Examples here as well as there.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
deviprasad

used  the follwoing code.

 

Local $oWordApp = _WordCreate(@ScriptDir & "Test.doc")
                      Local $oDoc = _WordDocGetCollection($oWordApp, 0)
                      $oDoc.Range.Text = "This is some text to print."

i f i go for a loop then it is not appending the text again ithink it is replacing the test i need to append the text

Share this post


Link to post
Share on other sites
water

The latest beta comes with a complete rewrite of the Word UDF. The changes are script breakting so don't expect old scripts to run with the beta or the next production version.

It supports new file formats and has a lot of additional functions.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
TheSaint

used  the follwoing code.

 

Local $oWordApp = _WordCreate(@ScriptDir & "Test.doc")

                      Local $oDoc = _WordDocGetCollection($oWordApp, 0)

                      $oDoc.Range.Text = "This is some text to print."

i f i go for a loop then it is not appending the text again ithink it is replacing the test i need to append the text

Well, logically you would need to get the existing text, append the new to it, then write the lot back to the document.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
water

Or use the Word UDF that comes with the beta version. You can move the insert location with function _Word_DocRangeSet.

See the examples in the help file.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×