Jump to content

Amatuer need help!


Recommended Posts

Hi to all, i'm extremely new to this s/w.

But i'm doing a rather important project.

its goes like this.

1)Open MS word.

2)type a few words, like, 'hi,how do u do?'

3)click on "save as"

4)Edit the file's name to like 'testing'

5)Select file type to be like 'xml'

6)lastly click 'save'

Pls do not ask me to go to the "HELP file", i seriously do not understand the contents.

I'm in urgently need pls kindly contribute and help.

Many thanks in advance, guys.

PS: MS word install in standard dir and screen size is 1024, 768

Link to comment
Share on other sites

  • Moderators

Hi to all, i'm extremely new to this s/w.

But i'm doing a rather important project.

its goes like this.

1)Open MS word.

2)type a few words, like, 'hi,how do u do?'

3)click on "save as"

4)Edit the file's name to like 'testing'

5)Select file type to be like 'xml'

6)lastly click 'save'

Pls do not ask me to go to the "HELP file", i seriously do not understand the contents.

I'm in urgently need pls kindly contribute and help.

Many thanks in advance, guys.

PS: MS word install in standard dir and screen size is 1024, 768

LMAO...

I won't ask you to go to the help file, in fact, I'll give you the answers.

1. Run()

2. WinMenuSelectItem()

3. ControlSetText() / Maybe ControlSend()

4. ControlSetText()/ Maybe ControlSend()

5. ControlCommand()

6. WinMenuSelectItem()

Now if you don't know what these are... THEN LOOK AT THE HELP FILE.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

you can do it using com as well

$word = objcreate("word.application"); to run word
$word.visible = 1; to show it
$word.documents.add; to make a new document
$word.selection.insertafter ("Whatever"); to type something
$word.documents.save; don't know what you exactly need but this safes

hope i could help you with this

Link to comment
Share on other sites

i think its easier to do the com-thing than to do

opt("wintitlematchmode", 2)
controlsend("Document", "", "_WwG1", "whatever")

because in com you can format the thing just as you want

$word.selection.font.size = 20

instead of

controlsend("Document", "", "_WwG1", "^9^9^9^9^9^9^9^9whatever^8^8^8^8^8^8^8^8")

or what do you think?

Link to comment
Share on other sites

he JUST wants something simple, not setting the font size

just type "hi how are ya" and save it as xml...

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

Hi to all, i'm extremely new to this s/w.

but he's new :)

so use the basics XD

i aint helping much because i think u REALLY need to learn this basic stuff from the help file, not the forum

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

I was going to suggest you write the XML file directly; however, Word's XML is ugly: :)

(Watch out for word wrap and note that AutoIt has a 4096-character limit per line)

CODE
$fileName = @ScriptDir & "\exampleOutput.xml"

FileWriteLine($fileName, '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>')

FileWriteLine($fileName, '<?mso-application progid="Word.Document"?>')

FileWriteLine($fileName, '<w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Title>This is a test</o:Title><o:Author>CyberSlug</o:Author><o:LastAuthor>CyberSlug</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>0</o:TotalTime><o:Created>2006-03-15T14:17:00Z</o:Created><o:LastSaved>2006-03-15T14:17:00Z</o:LastSaved><o:Pages>1</o:Pages><o:Words>6</o:Words><o:Characters>33</o:Characters><o:Company>AutoIt Forums</o:Company><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>38</o:CharactersWithSpaces><o:Version>11.6568</o:Version></o:DocumentProperties><w:fonts><w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/></w:fonts><w:styles><w:versionOfBuiltInStylenames w:val="4"/><w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/><w:style w:type="paragraph" w:default="on" w:styleId="Normal"><w:name w:val="Normal"/><w:rPr><wx:font wx:val="Times New Roman"/><w:sz w:val="24"/><w:sz-cs w:val="24"/><w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/></w:rPr></w:style><w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:semiHidden/></w:style><w:style w:type="table" w:default="on" w:styleId="TableNormal"><w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/><w:semiHidden/><w:rPr><wx:font wx:val="Times New Roman"/></w:rPr><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="list" w:default="on" w:styleId="NoList"><w:name w:val="No List"/><w:semiHidden/></w:style></w:styles><w:docPr><w:view w:val="print"/><w:zoom w:percent="100"/><w:doNotEmbedSystemFonts/><w:attachedTemplate w:val=""/><w:defaultTabStop w:val="720"/><w:drawingGridHorizontalSpacing w:val="120"/><w:displayHorizontalDrawingGridEvery w:val="2"/><w:displayVerticalDrawingGridEvery w:val="2"/><w:punctuationKerning/><w:characterSpacingControl w:val="DontCompress"/><w:optimizeForBrowser/><w:validateAgainstSchema/><w:saveInvalidXML w:val="off"/><w:ignoreMixedContent w:val="off"/><w:alwaysShowPlaceholderText w:val="off"/><w:compat><w:breakWrappedTables/><w:snapToGridInCell/><w:wrapTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr><w:body><wx:sect><w:p><w:r><w:t>This is a test</w:t></w:r></w:p><w:p/><w:p><w:r><w:t>Example text goes here</w:t></w:r></w:p><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/><w:cols w:space="720"/><w:docGrid w:line-pitch="360"/></w:sectPr></wx:sect></w:body></w:wordDocument>')

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

thks guys.

just saw your post and still dun seem to grab the concept. Pls dun "bash" me. I'm totally an idiot towards this thing. anyway, what should i really do? pls advice and contribute a workable one(with much appreciation!).

many tks,dudes & babes

Link to comment
Share on other sites

thks guys.

just saw your post and still dun seem to grab the concept. Pls dun "bash" me. I'm totally an idiot towards this thing. anyway, what should i really do? pls advice and contribute a workable one(with much appreciation!).

many tks,dudes & babes

here's the thing. you're not making any kind of an effort to do it yourself. if you don't care enough to atleast do the tutorials in the help file, or show some kind of effort at all, then noone is going to help you. you're not asking for much, but you've not DONE anything. in addition to the help file, there is a thread here that has a .pdf that one of the forum users has been working on. i'd point you that direction for your help.

***edit***

p.s. welcome to the best forum on the net. i genuinely hope you decide to put forth some effort to learn and you'll really enjoy autoit and this forum.

Edited by cameronsdad
Link to comment
Share on other sites

Script:

opt("wintitlematchmode", 2)
Run("winword")
WinWaitActive("Word")
Send("Hi, I have no idea what is AutoIt had have 100% no understanding of COM, so scram off{!}")
Send("!f")
Send("!a")
WinWaitActive("Save")
Send("testing")
Send("{ENTER}")

Breakdown (as usual, it's a habit)

Run("winword")
Run Microsoft Word (exe name is "winword")

WinWaitActive("Word")
Wait for the Window "Word" to appear

Send("Hi, I have no idea what is AutoIt had have 100% no understanding of COM, so scram off!", 1)
Send the string to Microsoft Word

Send("!f")
Go to the File Menu

Send("!a")
Select Save As

WinWaitActive("Save")
Wait for the SaveAs Dialog to appear

Send("testing")
Send the file name

Send("{ENTER}")
Press Save

#)

Tested on Microsoft Word 2000 (9.0.3821 SR-1)

EDIT: Chec this out AutoIt 1-2-3

Edited by nfwu
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...