ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 16th, 2003, 11:06 PM
JamesO JamesO is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 JamesO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Replacing text in MS Word from ASP

Hello

I am trying to open an MS Word document from an ASP page then use search and replace to modify the letter (e.g. name and address). I want to do this because of the control over the look and feel of the final letter.

The code I am attempting is:

set letter = CreateObject("Word.Application")
letter.Documents.Open("letter.doc")

letter.Documents(1).Content.Select
with letter.Documents(1).Selection.find
.Clearformatting
.Forward = true
.Wrap = wdWrapContinue
.Execute FindText:=strFind, Replace:=wdReplaceAll, ReplaceWith:=strReplace
end with


When I execute it I get an 'Expected Statement' error and the debugger is pointing at strFind.

What am I doing wrong?

Regards
James

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Replacing text in MS Word from ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT