RE: working with objects
OK, I am starting to think that it is MX that is not wanting to do this right, as I have even looked at some of the tutorials on how to print or create a word doc and the thing still crashes. I tested on 2 seperate MX servers, even changing the service to boot up using an admin account, and I am gettng the same errors. Anyone have a CF5 server with word installed where I can send something to them and test this out? If this is a big, would like to speak with MM about it. Thanks! Robert Bailey Famous for nothing -Original Message- From: Robert Bailey [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 10:40 AM To: CF-Talk Subject: RE: working with objects that is suppose to be not sure how to get that to work, lol Thanks! Robert Bailey Famous for nothing -Original Message- From: Robert Bailey [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 10:25 AM To: CF-Talk Subject: RE: working with objects The document is opening properly, my problem lies in when I do a word count, it counts the punctuation. So after reading the MS website, it tells me how to only count the words and ignore the punctuation, in VB, which is: Set temp = Dialogs(wdDialogToolsWordCount) temp.Execute numWords = temp.Words But I can not seem to get the above to execute in CFScript. The problem seems to lie in the "temp.execute" Now sure how to get that to work Thanks! Robert Bailey Famous for nothing -Original Message- From: A.Little [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 10:18 AM To: CF-Talk Subject: RE: working with objects I came across a similar problem and ended up having to change my code so that it looks like; objDoc = objWord.Documents; newDoc = objDoc.open("c:\mydocument.doc"); myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; MyComments = newDoc.Comments; MyCommentCount = MyComments.Count; So instead of using the object 'dot' notation as it should really be used, you can only have one dot per expression. Hence why I've got: myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; Instead of: MyRevCount = newDoc.Revisions.count Perhaps the reason your code isn't working is because the document isn;t being opened properly or at all (too many dots in your OpenDoc statement) HTH, Alex PS. Don't ask me why it works the way it does! > -Original Message- > From: Robert Bailey [mailto:[EMAIL PROTECTED] > Sent: 12 March 2003 14:51 > To: CF-Talk > Subject: working with objects > > > OK, working with the MS Word object (still). > > I need some help porting over this VB code to CF so that it > will work. Here > is the VB Code: > >Sub Test() > >Dim DocOpen As Word.Document > > >Set DocOpen = Documents.Open("c:\blah.doc") > >Set temp = Dialogs(wdDialogToolsWordCount) >temp.Execute >numWords = temp.Words > > >With DocOpen >MsgBox "This doc has a count of " & " " & numWords >.Close wdDoNotSaveChanges >End With >Set DocOpen = Nothing > >End Sub > > Works perfectly. So I am trying to get this to do the same > thing in CF, > without the msgbox, obviously. Here is where I have gotten: > > > >OpenDoc = objWord.Documents.Open("c:\blah.doc"); > >Count = opendoc.words.count(); > >temp = openDoc.Dialogs(wdDialogToolsWordCount) > >OpenDoc.Close(); > >objWord.Quit(); > >objWord = "Nothing"; > > > Does not work, it is telling me that wdDialogToolsWordCount > is undefined. So > I have even tried declaring a variable like "myvar = > "wdDialogToolsWordCount" and it still fails. How can I port > this VB over to > CFScript where it works? Can anyone help? Thanks in advance! > Thanks! > Robert Bailey > Famous for nothing > > > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: working with objects
that is suppose to be not sure how to get that to work, lol Thanks! Robert Bailey Famous for nothing -Original Message- From: Robert Bailey [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 10:25 AM To: CF-Talk Subject: RE: working with objects The document is opening properly, my problem lies in when I do a word count, it counts the punctuation. So after reading the MS website, it tells me how to only count the words and ignore the punctuation, in VB, which is: Set temp = Dialogs(wdDialogToolsWordCount) temp.Execute numWords = temp.Words But I can not seem to get the above to execute in CFScript. The problem seems to lie in the "temp.execute" Now sure how to get that to work Thanks! Robert Bailey Famous for nothing -Original Message- From: A.Little [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 10:18 AM To: CF-Talk Subject: RE: working with objects I came across a similar problem and ended up having to change my code so that it looks like; objDoc = objWord.Documents; newDoc = objDoc.open("c:\mydocument.doc"); myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; MyComments = newDoc.Comments; MyCommentCount = MyComments.Count; So instead of using the object 'dot' notation as it should really be used, you can only have one dot per expression. Hence why I've got: myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; Instead of: MyRevCount = newDoc.Revisions.count Perhaps the reason your code isn't working is because the document isn;t being opened properly or at all (too many dots in your OpenDoc statement) HTH, Alex PS. Don't ask me why it works the way it does! > -Original Message- > From: Robert Bailey [mailto:[EMAIL PROTECTED] > Sent: 12 March 2003 14:51 > To: CF-Talk > Subject: working with objects > > > OK, working with the MS Word object (still). > > I need some help porting over this VB code to CF so that it > will work. Here > is the VB Code: > >Sub Test() > >Dim DocOpen As Word.Document > > >Set DocOpen = Documents.Open("c:\blah.doc") > >Set temp = Dialogs(wdDialogToolsWordCount) >temp.Execute >numWords = temp.Words > > >With DocOpen >MsgBox "This doc has a count of " & " " & numWords >.Close wdDoNotSaveChanges >End With >Set DocOpen = Nothing > >End Sub > > Works perfectly. So I am trying to get this to do the same > thing in CF, > without the msgbox, obviously. Here is where I have gotten: > > > >OpenDoc = objWord.Documents.Open("c:\blah.doc"); > >Count = opendoc.words.count(); > >temp = openDoc.Dialogs(wdDialogToolsWordCount) > >OpenDoc.Close(); > >objWord.Quit(); > >objWord = "Nothing"; > > > Does not work, it is telling me that wdDialogToolsWordCount > is undefined. So > I have even tried declaring a variable like "myvar = > "wdDialogToolsWordCount" and it still fails. How can I port > this VB over to > CFScript where it works? Can anyone help? Thanks in advance! > Thanks! > Robert Bailey > Famous for nothing > > > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: working with objects
The document is opening properly, my problem lies in when I do a word count, it counts the punctuation. So after reading the MS website, it tells me how to only count the words and ignore the punctuation, in VB, which is: Set temp = Dialogs(wdDialogToolsWordCount) temp.Execute numWords = temp.Words But I can not seem to get the above to execute in CFScript. The problem seems to lie in the "temp.execute" Now sure how to get that to work Thanks! Robert Bailey Famous for nothing -Original Message- From: A.Little [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 10:18 AM To: CF-Talk Subject: RE: working with objects I came across a similar problem and ended up having to change my code so that it looks like; objDoc = objWord.Documents; newDoc = objDoc.open("c:\mydocument.doc"); myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; MyComments = newDoc.Comments; MyCommentCount = MyComments.Count; So instead of using the object 'dot' notation as it should really be used, you can only have one dot per expression. Hence why I've got: myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; Instead of: MyRevCount = newDoc.Revisions.count Perhaps the reason your code isn't working is because the document isn;t being opened properly or at all (too many dots in your OpenDoc statement) HTH, Alex PS. Don't ask me why it works the way it does! > -Original Message- > From: Robert Bailey [mailto:[EMAIL PROTECTED] > Sent: 12 March 2003 14:51 > To: CF-Talk > Subject: working with objects > > > OK, working with the MS Word object (still). > > I need some help porting over this VB code to CF so that it > will work. Here > is the VB Code: > >Sub Test() > >Dim DocOpen As Word.Document > > >Set DocOpen = Documents.Open("c:\blah.doc") > >Set temp = Dialogs(wdDialogToolsWordCount) >temp.Execute >numWords = temp.Words > > >With DocOpen >MsgBox "This doc has a count of " & " " & numWords >.Close wdDoNotSaveChanges >End With >Set DocOpen = Nothing > >End Sub > > Works perfectly. So I am trying to get this to do the same > thing in CF, > without the msgbox, obviously. Here is where I have gotten: > > > >OpenDoc = objWord.Documents.Open("c:\blah.doc"); > >Count = opendoc.words.count(); > >temp = openDoc.Dialogs(wdDialogToolsWordCount) > >OpenDoc.Close(); > >objWord.Quit(); > >objWord = "Nothing"; > > > Does not work, it is telling me that wdDialogToolsWordCount > is undefined. So > I have even tried declaring a variable like "myvar = > "wdDialogToolsWordCount" and it still fails. How can I port > this VB over to > CFScript where it works? Can anyone help? Thanks in advance! > Thanks! > Robert Bailey > Famous for nothing > > > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: working with objects
I came across a similar problem and ended up having to change my code so that it looks like; objDoc = objWord.Documents; newDoc = objDoc.open("c:\mydocument.doc"); myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; MyComments = newDoc.Comments; MyCommentCount = MyComments.Count; So instead of using the object 'dot' notation as it should really be used, you can only have one dot per expression. Hence why I've got: myRevisions = newDoc.Revisions; MyRevCount = myRevisions.count; Instead of: MyRevCount = newDoc.Revisions.count Perhaps the reason your code isn't working is because the document isn;t being opened properly or at all (too many dots in your OpenDoc statement) HTH, Alex PS. Don't ask me why it works the way it does! > -Original Message- > From: Robert Bailey [mailto:[EMAIL PROTECTED] > Sent: 12 March 2003 14:51 > To: CF-Talk > Subject: working with objects > > > OK, working with the MS Word object (still). > > I need some help porting over this VB code to CF so that it > will work. Here > is the VB Code: > >Sub Test() > >Dim DocOpen As Word.Document > > >Set DocOpen = Documents.Open("c:\blah.doc") > >Set temp = Dialogs(wdDialogToolsWordCount) >temp.Execute >numWords = temp.Words > > >With DocOpen >MsgBox "This doc has a count of " & " " & numWords >.Close wdDoNotSaveChanges >End With >Set DocOpen = Nothing > >End Sub > > Works perfectly. So I am trying to get this to do the same > thing in CF, > without the msgbox, obviously. Here is where I have gotten: > > > >OpenDoc = objWord.Documents.Open("c:\blah.doc"); > >Count = opendoc.words.count(); > >temp = openDoc.Dialogs(wdDialogToolsWordCount) > >OpenDoc.Close(); > >objWord.Quit(); > >objWord = "Nothing"; > > > Does not work, it is telling me that wdDialogToolsWordCount > is undefined. So > I have even tried declaring a variable like "myvar = > "wdDialogToolsWordCount" and it still fails. How can I port > this VB over to > CFScript where it works? Can anyone help? Thanks in advance! > Thanks! > Robert Bailey > Famous for nothing > > > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4