Member Login
Search
Jump to a Date
Sponsored Communities
Cool stuff
Twitter Feed
Neat Stuff

Visit our shop for nerds in control lifestyle products.
Thermal Overload
The threads that wouldn't die...
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
Fortune
Fortune's Fictitious Country Song Title of the Week:
"How Can I Miss You if You Won't Go Away?"
"How Can I Miss You if You Won't Go Away?"
RSS Feed
www.control.com/rss/
To get a personalized feed, become a member at no cost.
I would like to open a MS Word document from InTouch and go straight to a specific bookmark in this document. Has anyone done this?
Øyvind Haugland
Øyvind Haugland
You can try 2 Wonderware script functions startapp to open word and a specific doc then have wwexecute call a macro in word that goes to a specific bookmark.
> You can try 2 Wonderware script functions startapp to open word and a specific doc
> then have wwexecute call a macro in word that goes to a specific bookmark.
Thanks for all the answers. Here is how far I've come (still not able to run the macro in word, but I'm close to it):
This is a script that runs the macro "Makrotest" in Excel (Macro and Command are defined as MemoryMessagetag, Excel is already running in the background with the sheet "DDE_Test"):
Macro = "DDE_Test.xls!Makrotest";
Command = "[Run(" + StringChar(34) + Macro + StringChar(34) + ")]";
WWExecute( "excel", "system", Command );
It works! But let's make an equal script for running script in Word:
Macro = "Bookmark";
Command = "[Run(" + StringChar(34) + Macro + StringChar(34) + ")]";
WWExecute( "winword", "system", Command );
This doesn't work! I get the errormessage "Compile error: Sub or Function not
defined" in VB, and the macro "TmpDDE" were tried started (although I have made a macro in Word called "Bookmark" and run OK in Word).
I looked at the MS Webpage
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q17 7760. There it says how to run macros in other programs:
Excel: XL.Run "TestMacro"
Word: WD.Run "Project.Module1.WordMacro"
I tried to put in projectname and modulename in addition to the macroname, as this page says, but I wasn't able to run it without errors.
Does anyone have experience with/suggestions to how to solve this?
> then have wwexecute call a macro in word that goes to a specific bookmark.
Thanks for all the answers. Here is how far I've come (still not able to run the macro in word, but I'm close to it):
This is a script that runs the macro "Makrotest" in Excel (Macro and Command are defined as MemoryMessagetag, Excel is already running in the background with the sheet "DDE_Test"):
Macro = "DDE_Test.xls!Makrotest";
Command = "[Run(" + StringChar(34) + Macro + StringChar(34) + ")]";
WWExecute( "excel", "system", Command );
It works! But let's make an equal script for running script in Word:
Macro = "Bookmark";
Command = "[Run(" + StringChar(34) + Macro + StringChar(34) + ")]";
WWExecute( "winword", "system", Command );
This doesn't work! I get the errormessage "Compile error: Sub or Function not
defined" in VB, and the macro "TmpDDE" were tried started (although I have made a macro in Word called "Bookmark" and run OK in Word).
I looked at the MS Webpage
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q17 7760. There it says how to run macros in other programs:
Excel: XL.Run "TestMacro"
Word: WD.Run "Project.Module1.WordMacro"
I tried to put in projectname and modulename in addition to the macroname, as this page says, but I wasn't able to run it without errors.
Does anyone have experience with/suggestions to how to solve this?
No, and I don't know how you would. Perhaps a VBA macro in word might do it. You might try converting the file to HTML and opening it with a browser from InTouch. Most HTML books cover how to do this.
Create a button with an action link using the "Startapp" command. See your Help files for detailed description.
It would be something like;
Startapp "path1/winword.exe path2/filename.doc";
Note that the 'path1/' part must be the path to winword and 'path2/' must be the path to the file.
The path must not have any spaces in it as Winword doesn't seem to like this.
This will get Winword running with your file open (if your file exists). If it doesn't exist, it will at least get winword open. As for getting to a bookmark in the file, you're on your own.
Be careful to password protect this link as it is very easy for a reasonably smart guy to get to the internet through winword. This would open your system to all sorts of porn (and/or viruses if you have no firewall but have ADSL or cable
connection to the internet).
Good luck,
It would be something like;
Startapp "path1/winword.exe path2/filename.doc";
Note that the 'path1/' part must be the path to winword and 'path2/' must be the path to the file.
The path must not have any spaces in it as Winword doesn't seem to like this.
This will get Winword running with your file open (if your file exists). If it doesn't exist, it will at least get winword open. As for getting to a bookmark in the file, you're on your own.
Be careful to password protect this link as it is very easy for a reasonably smart guy to get to the internet through winword. This would open your system to all sorts of porn (and/or viruses if you have no firewall but have ADSL or cable
connection to the internet).
Good luck,
Øyvind,
Try to use
(From InTouch)
*WWStartApp to launch winword
*WWExecute to launch your Word Macro
(From Word)
*A Macro
You should make a tag which hold your bookmark value. This tag can you put in in a cell in the document. This cell read the value of your tag = the macro can read it.
The macro is moving you around in the document based on your bookmark value given from InTouch.
Morten Johansen
www.aventi.no
Try to use
(From InTouch)
*WWStartApp to launch winword
*WWExecute to launch your Word Macro
(From Word)
*A Macro
You should make a tag which hold your bookmark value. This tag can you put in in a cell in the document. This cell read the value of your tag = the macro can read it.
The macro is moving you around in the document based on your bookmark value given from InTouch.
Morten Johansen
www.aventi.no
Try Creating a macro that runs when you open the WORD document. Example (The name of the bookmark is "scope")::
Sub AutoOpen()
'
' Auto_Open Macro
' Macro created 6/7/02
'
Selection.GoTo What:=wdGoToBookmark, Name:="Scope"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
End Sub
Sub AutoOpen()
'
' Auto_Open Macro
' Macro created 6/7/02
'
Selection.GoTo What:=wdGoToBookmark, Name:="Scope"
With ActiveDocument.Bookmarks
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
End Sub
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2009 Nerds in Control, LLC. All rights reserved.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Patronize our advertisers!




