LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Manipulating Word Range object in Excel

I am juggling a couple of Microsoft application objects from within Excel VBA
Add-In.

Basically, I am creating an draft email using an Outlook object and using
Word object as editor (in Outlook) - all with Office 2003.

All working fine on a couple of machines but on one machine (same build as
others) the code is failing during a Find/Replace in the Word Range object.
It is actually causing Excel to crash with a 'Send to Microsoft' memory stack
error.

The code is roughly :-

Dim WdDoc as Word.Document
Dim WdRg as Word.Range
Dim objEmail As Object
Dim objDrafts As Object

Set objOutlook = New Outlook.Application
Set objDrafts = objOutlook.Session.GetDefaultFolder(olFolderDrafts )

Set objEmail = objDrafts.Items.Add
Set wdDoc = objEmail.GetInspector.WordEditor
Set WdRg = WdDoc.Range(2,100) ' assume text fred somewhere in this range

WdRg.Find.Text = "fred"
WdRg.Replacement.Text = "bert"
WdRg.Find.Execute

Any thoughts why the code should fail (big time, taking out Excel) just on
one machine but works OK on the other clone builds? A User option or Add-In
conflict?

Thanks,
Andy.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel object linked to word will not add sums in word Robin Excel Discussion (Misc queries) 0 March 31st 09 11:10 PM
Have problem in Manipulating Workbook Object and make macro shortest as possible Irmann Excel Worksheet Functions 0 February 5th 08 09:32 AM
Range Object CopyPicture Method; Paste to MS Word Marian Excel Programming 0 July 12th 06 04:31 PM
Manipulating MS Word from Excel?? Simon Lloyd[_802_] Excel Programming 5 June 27th 06 07:06 AM
Manipulating embeded exccel in word JD Excel Programming 0 February 9th 05 02:26 PM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"