obscurant1st Posted April 18, 2010 Share Posted April 18, 2010 Hi, I have two word files which i have to combine one after the other, it is containing lots of formatting and all. Sohow can i use auto it for combining both. Is there any UDFs for this? also I need to include Page Breaks after some predefined words. [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
BugFix Posted April 18, 2010 Share Posted April 18, 2010 Hi,I have two word files What you mean - two MS Word documents? Best Regards BugFix Link to comment Share on other sites More sharing options...
obscurant1st Posted April 18, 2010 Author Share Posted April 18, 2010 What you mean - two MS Word documents?ooops, I am sorry.Yeah I mean two MS word Documents!! [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
BugFix Posted April 18, 2010 Share Posted April 18, 2010 (edited) OK, this works so: #include <Word.au3> $sPath1 = "file1.doc" $sPath2 = "file2.doc" $oWord = _WordCreate($sPath1, 0, 1) ; visible With $oWord.Selection .EndKey(6) .InsertBreak(7) .InsertFile($sPath2) EndWith Edit: Best way to find out this: Make an macro in word, that this things do, than open VBA and translate this to autoit-code. Edited April 18, 2010 by BugFix Best Regards BugFix Link to comment Share on other sites More sharing options...
obscurant1st Posted April 18, 2010 Author Share Posted April 18, 2010 thx man, that helps a lot. [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
obscurant1st Posted April 21, 2010 Author Share Posted April 21, 2010 will this work with .docx format also? coz i am getting an error like : ==> The requested action with this object has failed.: $o_doc = $o_object.Documents.Open ($s_FilePath, $f_ConfirmConversions, $f_ReadOnly, $f_AddToRecentFiles, $s_PasswordDocument, "", $f_Revert, $s_WritePasswordDocument, "", $i_Format) $o_doc = $o_object.Documents.Open ($s_FilePath, $f_ConfirmConversions, $f_ReadOnly, $f_AddToRecentFiles, $s_PasswordDocument, "", $f_Revert, $s_WritePasswordDocument, "", $i_Format)^ ERROR [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 21, 2010 Moderators Share Posted April 21, 2010 Add this toward the top of your script. _WordErrorHandlerRegister() Link to comment Share on other sites More sharing options...
obscurant1st Posted April 22, 2010 Author Share Posted April 22, 2010 >Running:(3.3.6.1):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\oDx\Desktop\Macro\test.au3" C:\Program Files\AutoIt3\Include\Word.au3 (1293) : ==> Variable used without being declared.: Return SetError($_WordStatus_Success, 0, 1) Return SetError(^ ERROR then this error comes!! [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
obscurant1st Posted April 24, 2010 Author Share Posted April 24, 2010 (edited) sorry for the double post, but i really need some help here, pls!! :| Edit: solved I had to give "_WordErrorHandlerRegister()" after header file, i wax giving it the begining! thanks!!! Edited April 24, 2010 by obscurant1st [u]We don't need people who can spit back facts. We've got Google."[/u] WebguruBB - Free Hosting, Domains, and SEO articles.Awesome Techs - Tips, Tricks and Some Technology NewsCool Facts - Cool Facts, Fun Facts, Weird Facts etc. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now