Minor Problem When Scripting MS Word

I think I'm just overlooking something obvious, but I have an AppleScript that works flawlessly--the FIRST time it's run on a file opened in Word--but the only way to run it again with another file is to quit Word and THEN open another file and run it. Otherwise I get the error message "Microsoft Word got an error: find id 365340008 of selection doesn’t understand the execute find message."
I've tried inserting "clear formatting" in several places, but it doesn't seem to cure it. Any advice would be much appreciated. Here's the script (it's basically a find/replace routine for typesetting):
tell application "Microsoft Word"
set view type of view of active window to normal view
set pagination to false
type text selection text "<ASCII-MAC>"
type paragraph selection
set wrap to find continue
set match wildcards to false
set findRange to find object of selection
tell findRange
execute find find text "<@$>" replace with "<cstyle:>" replace replace all
execute find find text "•" replace with "<0x2022>" replace replace all
execute find find text "©" replace with "<0x00A9>" replace replace all
execute find find text "°" replace with "<0x00B0>" replace replace all
execute find find text "…" replace with "<0x2026>" replace replace all
execute find find text "¶" replace with "<0x00B6>" replace replace all
execute find find text "®" replace with "<0x00AE>" replace replace all
execute find find text "™" replace with "<0x2122>" replace replace all
execute find find text "§" replace with "<0x00A7>" replace replace all
execute find find text "–" replace with "<0x2013>" replace replace all
execute find find text "—" replace with "<0x2014>" replace replace all
execute find find text "“" replace with "<0x201C>" replace replace all
execute find find text "”" replace with "<0x201D>" replace replace all
execute find find text "‘" replace with "<0x2018>" replace replace all
execute find find text "’" replace with "<0x2019>" replace replace all
end tell
tell findRange
set match wildcards to true
execute find find text "<@(*)>" replace with "<cstyle:\1>" replace replace all
execute find find text "@(*):" replace with "<pstyle:\1>" replace replace all
end tell
end tell
(I had to eliminate some back slashes from the last two find/replace lines so it would appear correctly here, but the original has them in there as escape characters.)

Hi,
These lines set wrap to find continue
set match wildcards to false
should be in the "*tell findRange*" block.
tell findRange
set wrap to find continue
set match wildcards to false
execute find find text "<@$>" replace with "<cstyle:>" replace replace all

Similar Messages

  • Link problem when converting MS Word to PDF with Acrobat Professional

    Hello all,
    I have the following problem:
    When I have a MS Word document with links to other files inside and I convert it to PDF the links are converted from relative paths to absolute paths.
    The problem is created by Acrobat as the links in the MS Word file are relative (I have checked this by moving the different docs to another directory and confirmed that the links still work after the move).
    How can I make the paths in the PDF relative again? I know there is a plugin from Evermap (and I can confirm this works) but I do not want to use this plugin (=read: spend another $190 dollars) as the license for the Acrobat Professional is expensive enough . Is there a way I can convert the paths within Adobe Acrobat easily? Or better: can I adjust the settings in Acrobat to a new standard when all converted documents contain relative paths?
    Backgroundinfo:
    - Adobe Acrobat 8 Professional
    - Windows XP (SP2)
    - MS Word 2002
    Thanks in advance!
    Bart

    Dear Steve,
    I have tried what u suggested: I put all the documents (word + linked documents) into the same folder on the local-drive (C). Then I recreated the links  in the word document to be sure they were matching. After that I converted the word document to an PDF and confirmed the links were still working in the PDF document.
    Then the biggest challenge: copying the pdf and linked documents to another drive&directory. As you can guess: Unfortunately the links did not work anymore.
    Any other suggestions?
    If I use the Evermap-tool (30 day-trial) I can look at the links and this is how it is 'coded' in the pdf.
    first link: ../../../../test/link_a.pdf
    second link: ../../../../test/link_b.pdf
    and yes this will work if you put the documents in the directory test in the root of the local-drive but not in a different subdirectory.
    Anyone ideas?
    Grtz,
    Bart

  • Problem when chenging a word file into PDF

    when I convert a word file into a PDF one, the whole font of the file changes. I use in the original document arial 12, when I convert the file the size and font of the whole file changes, what can I do to avoid that to happen??? IT'S URGENT I use microsoft word 2010

    Hi astridlenina,
    How well a file converts depends largely on the quality of the original file.
    Would you send your PDF document to [email protected] as an email attachment? 
    I will check it from my end.Please add the link to this forum post for reference.
    Regards,
    Florence

  • Error when open microsoft word

    I am having a problem when open existing word file. Last time in LV 6.1 working fine. then I switch to LV8, then I cant open. I upgrade to LV8.01 then the problem solve. but somehow it still give me error even in lV 8.01. when I transfer the working VI to another PC with LV8.01, still give me error. I do not know why. please advise.
    When you feel sad, laugh
    Attachments:
    error.llb ‏151 KB
    error3.JPG ‏55 KB
    no error.JPG ‏57 KB

    Hi, the screen shots are taken on the same computer.
    Sorry I uploaded the whole llb. In fact the vi that contain error is the “open existing file.vi”in that llb and that vi has a problem. Like I posted in my screen shot, one cannot be run with broken arrow however the other one can be run on the same PC (but I noticed that the invoke node input are a bit different from one and another).
    And when I transfer those vi on another PC (with same version of LV8.01) and it somehow become reverse (problem vi become no problem and no problem vi become problem). Both using office xp and window xp so I do not know what is the error. Like you say may be somehow because of the office version but I don’t get it since both PC use office xp.
    Thanks and with best regds,
    Nayisoe
    When you feel sad, laugh

  • Problems when i copy text from Pdf and paste on Word

    In Pdf documente the text is in perfect conditions, but, when i copy the text and paste in WORD document the character change into random crazy character like: "()*"*&!(!*"(!"(!)"( )*"()!*("!&("@*")(!*@"!*@(
    how i fix this??

    I have the same problem when copying the PDF into a Word file. I tried Save as RTF doc. and it is still just symbols.
    It could be a font problem, because it has some weird Gill Sans and Futura fonts. I am sending a picture as an example.
    The option of exporting as Tiff and then applying OCR is interesting but still is kind of slow when i have a 100 pages document. If the fonts is the problem is there any way i could select the whole text and apply it a known font like Arial?
    Thanks for any info!
    Cheers,
    Sebastian

  • Hyperlink problem when converting Word to PDF

    Hi everyone.
    I am using Adobe Acrobat 7.0 Standard version 7.1.4 on a Windows 2000 environment.
    I am using Word XP/2002 SP3.
    I have a couple of problems when converting Word to PDF.
    When converting a long link which is in 2 lines, PDF just takes one line into account, not considering the whole link
    When I have hyperlinks that links to a web page, the link works fine in Word but in pdf, it gets the few words after the url address making the link not work.  For example.  I have a hyperlink that http://www.google.com/ and after this I have the words: "This is a sample text".  The hyperlink in pdf would then become http://www.google.comThisisasampletext
    Do you have any ideas how I can correct this?
    Thanks.

    To get the cross references, you have to use Convert to PDF (PDF Maker part of the Acrobat product). However, you first need to go to the print menu and set the printer to the Adobe PDF printer. Close the print menu and then do a reflow and link update of the document (ctrl-A, then F9 I think). This is needed to get the links correct since WORD reflows the document based on the printer (problem with them going to the wrong place).
    Printing to the Adobe PDF printer (the step of print to file is not needed, just print to the printer and the rest is automatic) does not include the links. PDF Maker is a PreProcessor for the Adobe PDF printer that adds PDF Marks to the PS file before it is sent to Distiller (OK, the printer when used normally creates a PS file and then invokes Distiller to complete the process - your steps did with the Adobe PDF printer is the same process done manually).
    Summary:
    1. Fix document after setting the printer to Adobe PDF.
    2. Use PDF Maker (create PDF button)

  • For the last 2days I have had the words " No Service" in the top left hand corner of my iPad? This causes intermittent  problems when logging into some  websites and Downloading some emails? I currently run a wifi network of 1 iPad and 1 desktop compuHelp

    For the last 2days I have had the words " No Service" in the top left hand corner of my iPad? This causes intermittent  problems when logging into some  websites and Downloading some emails? I currently run a wifi network of 1 iPad and 1 desktop computer. The wifi unit is  a iinet BOB 2 unit. The other computer works completely fine. The only problem is with this apple iPad? I have rebooted iPad and rebooted BOB 2 wifi unit but this has made on difference to the problem?
    Can anyone suggest any HELP
    Thank You

    For the last 2days I have had the words " No Service" in the top left hand corner of my iPad? This causes intermittent  problems when logging into some  websites and Downloading some emails? I currently run a wifi network of 1 iPad and 1 desktop computer. The wifi unit is  a iinet BOB 2 unit. The other computer works completely fine. The only problem is with this apple iPad? I have rebooted iPad and rebooted BOB 2 wifi unit but this has made on difference to the problem?
    Can anyone suggest any HELP
    Thank You

  • Strange problem when opening word doc situated in WLS virtual dir

    Hi all,
    we have a strange problem when opening word doc
    situated in C:\Oracle\Middleware\as_1\forms\webutil
    we put some word docs there and tried to open from forms using for example web.show_document('http://wp0606:9001/forms/webutil/mug00103.doc', '_blank');
    no problem using FF, however in IE8 the word doc is shown in its binary format, this also happens when we try to open the doc in IE8
    however when we google and search for instance for a test.doc and then click on this url a file save dialog is shown
    that's why we believe that this might be due to a configuration issue of WLS
    any help would be greatly appreciated
    Kr
    Martin

    I think you have 2 ways to go here. Figure out what html is from wherever weblogic gets it, meaning you have to delve into the docs, snoop
    around in directories and find what it must be sending (This is going to be unavoidable if you are going to change what weblogic is doing.
    Sooner or later you have to try to figure out where it gets this stuff from)
    or
    you can experimentally snoop on your url with a tool like wget or curl. These are fundamental web tools.
    The latter is always a useful thing to be able to do. (you need to formulate a query to get the content-type).
    Whoever managed to get weblogic to serve any files in the first place probably can figure this out.

  • When I receive word documents via my yahoo on my mac, the format always come up as a TEXTEDIT doc.  This is causing me serious problems.  How do I enable my documents to open in the original format it was sent?

    when I receive word documents via my yahoo on my mac, the format always come up as a TEXTEDIT doc.  This is causing me serious problems.  How do I enable my documents to open in the original format it was sent?

    Do you have Microsoft Word installed on your Mac? If so, you can reassign all .doc files to Word by selecting the file in Finder and choosing "File > Get Info" from the menu. In the window that opens look for "Open with" and change the entry to "Microsoft Word".

  • Why does Acrobat Pdf converter file slow down my 2003, Windows  Word Program.  I only experience this problem when i convert a pdf file to a doc file.

    Why does Acrobat Pdf converter file slow down my 2003, Windows  Word Program.  I only experience this problem when i convert a pdf file to a doc file.

    Hi Bill -- thanks for your reply!
    When I check the Document Properties on Acrobat I can see that the fonts used in the document (Cambria, Times and Windings) are listed as "Embedded Subset" in the Fonts panel. The machine it was created on did use an earlier version of OS X and an old version of Word, but it seems to have the proper fonts...
    -nick

  • Advertisements cover up some of the script on the page and when I type words into the search box, the letters are only half way visible

    On my home page in the Google search box, when you type words the letters are cut off on the bottom. Also advertisements are on top of writing or things I want to see on web pages.
    == This happened ==
    Every time Firefox opened

    Reset the page zoom on websites that look wrong: "View > Zoom > Reset" ( Ctrl + 0 (zero))
    See http://kb.mozillazine.org/Zoom_text_of_web_pages
    If you increased the minimum font size then try a lower setting (default is ''none'') as a too high value can cause issues like you described.
    Tools > Options > Content : Fonts & Colors: Advanced > Minimum Font Size
    Tools > Options > Content : Fonts & Colors: Advanced > "Allow pages to choose their own fonts, instead of my selections above"

  • Minor problem - I have 4 folders in the dock, but when I press on the icons for two of them, there is no choice of "display as folder" or "options". Can somebody tell me why not? Thanks!

    I have four folders in the dock. Two are fine. The other two of them will not allow me to press on the stack's icons to view the commands "Display as Folder" or "Options". Can somebody help me out with this minor problem?
    Thanks!

    Are you right - clicking (control-clicking) them? The following should appear if you do that, and allow you to change the folder's appearance in the Dock:

  • Generally when creating a Word file from either a Mac or Win7 pc and opening it on two different machines (either one first) it always prompts that the file is open and will be opened as read only. However opening a CSS file does not prompt that it is alr

    Generally when creating a Word file from either a Mac or Win7 pc and opening it on two different machines (either one first) it always prompts that the file is open and will be opened as read only.
    However opening a CSS file does not prompt that it is already open on or from any machine which is causing code edits to be lost.
    What we found from out testing:
    - The file can be saved from one user to the server and WILL NOT PROMPT on other machines until the saving machine has the Dreamweaver program closed completely
    - The file can be closed and  Dreamweaver minimised to the launch bar but it still will not register on other machines that it has been changed.
    - Also, until the  Dreamweaver program is closed on the machines, it will continue to open it's saved version of the file. 
    Example Scenario:
    - User 1 opens test.css (which is 2000 lines) and adds some code to the end of the file to bring it up to 2500 lines
    - Meanwhile User 2 opens test.css as well (opens as 2000 lines as User 1’s edits have not yet been saved) and adds in code to bring it to 2300 lines
    - User 1 saves his file and closes it - but  Dreamweaver is still open.
    - User 2 also saves his file and leaves  Dreamweaver  open.
    - The server will report the size and last edit of the file the same as User 2 as he was the last person to save it (and if you open from the Win7 Machine it will show as User 2’s 2300 line version)
    - If User 1 then open's the file again (from either the 'recent' in Dreamweaver OR clicking on the file directly in Finder...which version opens.... The version that User 1 saved! Not the true version on the server, but the version that User 1 edited and saved with 2500 lines in it.
    - Same for User 2, he will open 'his' version with 2300 lines in.
    Other information:
    - Files are opened directly from the server
    - Sometimes the users will save incrementally and re-open
    - Most of the time users will save incrementally and keep the files open
    - The users will never not save incrementally and just save when closing the file once finished
    - The users are usually working on the files all day
    - It is always the bottom lines of code that are lost. It could be a case of the two versions being mixed up and cutting off the newly added lines based on the line count (possibly).
    It is as if Dreamweaver is holding a cache of the version locally and then only properly looking back to the server when it has been completely closed. It is very difficult to see how the server is causing such an impact on these files, there are very few logs which are giving any indication to the root cause of the problems.
    Anyone know if this is a known issue?
    Is there a way that there can be a featured implemented on the server that doesn't allow another user to open a file if it is already open on another machine?
    Thanks

    Your server file handling has nothing, and really nothing to do with Adobe software. If files don't get locked for (over-)writing and/or lose connection to the program opening them, then your server is misconfigured. It's as plain and simple and that. Anything from "known file types"/ file associations not being set correctly, MIME types being botched, crooked user privileges and file permissions, missing Mac server extensions, delayed file writing on the server, generic network timeout issues and what have you. Either way, you have written a longwinded post with no real value since you haven't bothered to provide any proper technical info, most notably about the alleged server. Either way, the only way you can "fix" it is by straightening out your server and network configuration, not some magic switch in Adobe's software.
    Mylenium

  • Firefox gets problems when 2,7 GB of memory is used by Firefox

    Firefox gets problems when 2,7 GB of memory is used by Firefox. Or more. Like 2,8 GB.
    It started when I read jpost.com with tens of tabs open. I don't remember how many. But I know there was more than 40.
    On the tab I that I was reading, the page turned completely black. Pitch black with nothing else, not even the Firefox interface. It was actually a pitch black shape that looked like a web page in shape. The blackness quickly disappeared and the page was normally readable again. But then it happened again - the page turned black again.
    The same page turns black happened again later.
    One of my browsing sessions had Firefox slow down so much that you could see scrolling happening when I used scrolling.
    Still another time I had 60 tabs open and Firefox worked completely fine without freezes, slowdowns, or black shapes. I could close Firefox by just pressing the red X in the title bar.
    Yesterday, I had 50 tabs open and I experienced a slowdown when I looked at the Breaking News headlines. The headlines would show slower than usual. The Breaking News headlines at jpost.com show the headlines a few words at a time until the headline is completely shown. Then the headline disappears and the next starts showing a few words at a time. And speed in general was not what you normally have with a computer that has 8 GB of memory. And a Core i5 processor. I opened two more tabs from the Breaking News section I had opened. After I opened a new window, Firefox froze. I had to close Firefox from the Task Manager by pressing End process. I had used Firefox for 6 hours without ever closing any of the tabs I had opened.
    In all of these cases, more than 40 tabs were open. In all of these cases, the slow down or freeze meant I had to use Task Manager and then press End process on the Processes tab. In all cases except the two I describe in the next paragraph, I never close any tabs after opening them. No problems have ever happened until Firefox started using 2,7 GB of memory. Until that point, everything is normal with no freezes or slowdowns.
    At two times, I tried to reduce memory usage by closing tabs. However, in both cases this would make Firefox freeze. In one of these cases, Firefox would show something bizarre: there would be about 7 tabs, and one of the tabs would be partly shown. Also, Firefox would show the busy cursor. Firefox did not show how many tabs I actually had. The second time, I tried to close the tabs by clicking Close other tabs in the menu that you get when right-click a tab. The tabs would close fine, but I remember that I opened Gmail and then I did this: I clicked on the Promotions tab. Instead of seeing the tab with the Emails, Firefox showed a busy cursor and the title bar said not responding. Firefox froze.
    The reason might be Adblock Plus memory usage. In Adblock Plus home page, developer Wladimir Palant writes in his blog about how Adblock Plus uses a lot of memory: https://adblockplus.org/blog/on-the-adblock-plus-memory-consumption .

    One more bit of information: I have a Geforce 640 GT graphics card. My graphics card drivers are old- version 311.41. The newest version of the drivers is 340.52. Would a new graphics card driver solve the problem?

  • Printing problem when PDF is sent to the printer with certain fonts - missing text

    I'm running into a printing problem when PDFs containing certain characters of the Calibri font are used.  The text in large sections of the PDF is missing on the paper version, but the text is there on the screen.  It's also happened when the PDFs we created were e-mailed out to a client and printed on their printer.  The problem is not present when printing directly from the programs (Microsoft Word, Excel, Visio, etc.).  I've been trying to get tech support from Adobe on this, but every time I call they apologize and say they will call back in 4-6 hours with an answer.  Same result each time, no call back.  If anyone from Adobe is listening, it's case number 184891587.  The font appears as an embedded subset when I look at the document properties.  Sometimes deleting one or two Characters allows for larger text blocks to be printed - i.e. removing a long dash in bold from the heading of a paragraph makes the paragraph reappear when printed to paper from PDF.  In all cases the PDF appears correct on the screen.  Printing as an image allows the text to appear, but the image quality isn't acceptable for small text, even at the 600 dpi setting on the printer.  If the PDF is sent out by e-mail, we do not have control over the end-user's printer setup anyway, so we need this to work in all cases.  
    The setup/process I'm using is as follows:
    Windows 7 Professional SP1 64-Bit
    Microsoft Office 2013 - problem is present when printing documents from Word, Excel or Visio.  Even other variations on documents. 
    I've tried Acrobat versions 11.0.0 to 11.0.5 as well as Acrobat Pro 11.0.0 and 11.0.1.  Same Result
    Printing to Adobe PDF as the printer, from the third party application
    Printing to a Xerox printer from PDF using Acrobat - Text missing
    Client prints to Konica printer - Text missing
    I print to the wide-format Ricoh (which also does 11x17) and the text is present. 
    Is there something I'm missing?  Is the entire font not getting embedded into the PDF file?  I noticed that rolling back to a much older version of the Calibri font (1.02 compared to 5.72) makes the problem mostly go away, but it's not completely gone.  Is it possible the font is too large to be completely embedded?  Where can I go from here? 

    Success!  At least for now.  It looks like my problem was fixed with Adobe's most recent update, 11.0.06.  From the release notes:
    PDF creation
    Added support for Lotus Notes 9.
    Added support for WebCapture in IE 11.
    Added support for conversions from AutoCAD 2013.
    3652540 A blank pdf is created for files having hidden visual style.
    3601108 Flow Chart converts as a multicolored square.
    3654345 Word documents missing parts of images in conversion to PDF.
    3654572 Temporary file size increases when creating pdf by combining multiple files into one PDF.
    3670155 PDF file created with Distiller XI prints incorrectly to some printers. (Emphasis mine)
    3599407 Checkbox check marks do not appear in these files.
    3663233 IE Web Capture in localized OS: Icons and drop-down menu items are missing and conversion dialog is not localized.
    3651931 Chrome Only: Few web pages when converted to pdf from Chrome plugin doesn’t show up the Save As dialog.
    3597910 EPM Mode On: Web capture is not working on Windows 8-32 bit when cache folder is missing.
    3610644 Firefox 23.0: With Firefox version 23.0 (latest), the WebCapture icon shows up very dim as if it is disabled.
    3650244 ODA falis to convert DWG files to PDF for large files.
    I don't know if that's definately what solved the problem, but it sure sounds similar and this is the update that made the printing problem go away.  We can't get the PDFs to fail at this point with our printers, even with Calibri 5.72.  I'll come back to thread if we have printing problems at the end-user locations. 

Maybe you are looking for

  • How to keep Motion created titles looking sharp on final DVD?

    Hello again... I'm having trouble keeping my motion created titles looking sharp on the final DVDSP project. Im exporting a title sequence out of motion into fcp and then exporting the full project via compressor for burn in DVDSP. I'm familiar with

  • Upgrade question for ISE 1.1.1 to 1.1.2 patch 8

    Hi everyone, I need some advise on upgrading from ISE 1.1.1 patch 3 to 1.1.2 patch 8... I have read the upgrade document on the Cisco website http://www.cisco.com/en/US/docs/security/ise/1.1.1/upgrade_guide/upgrade.html and tried to understand it pro

  • Cannot use loopback address in jmf audio receiver

    Hello, i am using the code from http://java.sun.com/products/java-media/jmf/2.1.1/solutions/AVReceive.html about transmitting and receiving audio data. It works fine but if i use a 127.0.0.1 address the receiver cannot connect to the audio streamer.

  • IDoc on HTTP adapter

    Hi, what are the steps to post idoc on HTTP adapter. Regards, Anurag

  • ORA-06503 Function returned without value

    Hi All, I'm getting ORA-06503: PL/SQL: Function returned without value error on this function..... can u guide me where Im going wrong? Cheers! I FUNCTION XX(P_Trial_No IN PATIENT_VISITS.TRIAL_NO%TYPE, P_PATIENT_VISIT_NO IN PATIENT_VISITS.PATIENT_VIS