Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-05-2016, 09:31 PM
tuanvu0695 tuanvu0695 is offline
Registered User
 
Join Date: Dec 2015
Posts: 4
Talking interactt with word

can i copy text value from crt to word file by scripting? thanks
Reply With Quote
  #2  
Old 01-06-2016, 07:17 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,997
Hi tuanvu0695,

What version of SecureCRT are you using?

On what platform?

I assume Windows if by "word file", you mean Microsoft Word, but I want to verify that.

What are you trying to accomplish (broader picture)?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 01-12-2016, 03:33 PM
tuanvu0695 tuanvu0695 is offline
Registered User
 
Join Date: Dec 2015
Posts: 4
hi bgagnon,

im using securecrt 7.1.1, i could be able to get some text from screen, i just wonder if there is a way to open a MS word file and paste to it, its even better if i can keep that word file open and just copy output there, thanks

regard,

tuan vu
Reply With Quote
  #4  
Old 01-13-2016, 12:24 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 931
Quote:
Originally Posted by tuanvu0695 View Post
hi bgagnon,
im using securecrt 7.1.1, i could be able to get some text from screen, i just wonder if there is a way to open a MS word file and paste to it, its even better if i can keep that word file open and just copy output there, thanks
It is possible to open a MS Word file and "paste to it", but I'm not sure if that's all you really need. The following questions come to mind:
  1. Does the word file (.doc/.docx) already exist?
  2. Is the word file already opened in MS Word (is the MS word application open and running with the word file document loaded/opened)?
  3. Where, specifically, should the data be pasted? Is it always the same location, or does it depend on where the insertion caret is within the document?
  4. What data are you wanting to transfer from the SecureCRT window? Just the Selection? The entire contents of the Screen? Rows 5-7? Something else? Please be specific.

If you can give a detailed description of what you're trying to do, including how you do it manually right now (without a script), we'll have a better understanding and be able to provide you with more information, if possible.

--Jake
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #5  
Old 01-19-2016, 08:55 AM
umbongo umbongo is offline
Registered User
 
Join Date: Oct 2015
Posts: 13
Hi,

You can put whatever you want in to a word file via a script; you just need to call the correct VB word commands to manipulate it.

I do exactly the same with excel by grabbing a copy of the configs and putting it in to excel, one column per router.

some example Excel-based commands to get you going in the right direction:
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
objExcel.ActiveSheet.Cells.Font.Size = 10
objExcel.ActiveSheet.Cells.Font.Name = "Calibri"
objExcel.Cells(3, 1).Value = "<" & yourVariable & ">"


It's then just a matter of looking up the correct code for word. This is a good start:
https://msdn.microsoft.com/en-us/lib...ffice.14).aspx
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 03:25 AM.