tag:blogger.com,1999:blog-284600789737488130.post3663007481825289936..comments2024-02-07T02:22:20.642-05:00Comments on Ruby on Windows: Find & Replace with MS WordDavid Mullethttp://www.blogger.com/profile/05597492688893461137noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-284600789737488130.post-49947016491607993272013-11-06T06:14:27.020-05:002013-11-06T06:14:27.020-05:00Thank you very much. This article helped me to do ...Thank you very much. This article helped me to do my task..Sudeepnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-18591565184313927172012-05-08T02:33:05.236-05:002012-05-08T02:33:05.236-05:00Hi David,
This is a wonderful article. It helped ...Hi David,<br /><br />This is a wonderful article. It helped me with writing my first application using OLE (I know about ole_methods, but I would still need to use an application to explore OLE objects, and none of those work with my screen reader).<br /><br />Thanks for writing it!Anonymoushttps://www.blogger.com/profile/00740436398479201453noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-78759935814932580382007-12-26T22:17:00.000-05:002007-12-26T22:17:00.000-05:00Denise-I'm not certain if I understand your proble...Denise-<BR/><BR/>I'm not certain if I understand your problem. You might try coverting Company.name to a string...<BR/><BR/>document.bookmarks.item("bkCompany").range.text = Company.name.to_s<BR/><BR/>...if Company.name returns nil. nil is an object whose to_s method returns an empty string.<BR/><BR/>Alternatively, you could perhaps wrap the code in a begin... rescue.. end block...<BR/><BR/>begin<BR/>document.bookmarks.item("bkCompany").range.text = Company.name<BR/>rescue<BR/>end<BR/>...to ignore any error occurring between the begin and rescua statements.<BR/><BR/>Hope that helps.<BR/><BR/>DavidDavid Mullethttps://www.blogger.com/profile/05597492688893461137noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-42071406711982352832007-12-21T15:50:00.000-05:002007-12-21T15:50:00.000-05:00Great post. Very helpful.I'd like to use either b...Great post. Very helpful.<BR/><BR/>I'd like to use either bookmarks or document properties, though. <BR/><BR/>document.bookmarks.item("bkCompany").range.text = Company.name<BR/><BR/>document.CustomDocumentProperties("dpCompany").Value = Company.name<BR/><BR/><BR/>That way if I don't have a value to substitute, I won't have a [replace this] placeholder in my finished document.<BR/><BR/>I'm having a problem with that though... if there isn't a value, the code stops and gives an error. <BR/><BR/>Any advice on whether I should (a) find a why to ignore errors for that section of code or (b) try something else?<BR/><BR/>Thanks!GorgeousSoulhttps://www.blogger.com/profile/04456914792614836534noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-13834370463065499452007-11-22T09:50:00.000-05:002007-11-22T09:50:00.000-05:00Thanks, Rainer & Paul!@Gerard:"...then generate ne...Thanks, Rainer & Paul!<BR/><BR/>@Gerard:<BR/><BR/>"...then generate new pages..."<BR/><BR/>The doc.SaveAs method saves the modified document to a new file. Feel free to email me directly if that doesn't answer your question.<BR/><BR/>DavidDavid Mullethttps://www.blogger.com/profile/05597492688893461137noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-86065319662065980962007-11-21T16:25:00.000-05:002007-11-21T16:25:00.000-05:00Can you point me towards how I would substitute th...Can you point me towards how I would substitute the text on a master page then generate new pages for very large mailings?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-13772682434994360452007-11-21T15:56:00.000-05:002007-11-21T15:56:00.000-05:00I'm glad to see your back in action David!I'm glad to see your back in action David!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-15581429575663430192007-11-18T14:39:00.000-05:002007-11-18T14:39:00.000-05:00Hello David,thanks for the example. It was very in...Hello David,<BR/><BR/>thanks for the example. It was very instructive for me. However, there was a tiny error with it. You need to put an end to the iterator loop that replaces the values for the keys.<BR/><BR/>Kind regards,<BR/><BR/>RainerRainerhttps://www.blogger.com/profile/11054527776182098356noreply@blogger.com