Jump to content
Sign in to follow this  
13lack13lade

Need to embedd word into gui !

Recommended Posts

13lack13lade

Hi Guys,

Wanting to have a listbox with a list of Modules and when you select the module it has another object next to it (not sure what to use? quite large amount of text though so cant be a label unless it has a scroller lol) that is linked to a word document that will show the text in the object window, and if possible the pictures in the word document aswell..

Or something that will do the same thing :)

Edited by 13lack13lade

Share this post


Link to post
Share on other sites
13lack13lade

is this even possible? i dont want anyone to be able to edit it or anything like that, just display the text in the word documents in a 'window' inside my GUI itself.

Edited by 13lack13lade

Share this post


Link to post
Share on other sites
water

Something like this?

$hGui = GUICreate('Embedded Word', 600, 750, -1, -1)
$oDoc = ObjCreate("Word.Document")
$Obj_ctrl = GUICtrlCreateObj($oDoc, 0, 55, 600, 660)

GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case -3
            Exit
    EndSwitch
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
13lack13lade

hey water, no not like that.. infact far less complicated..

hoping to have a bunch of options in a listbox and you click one and it will have a bunch of text assigned to it that will show in the object next to it.

Thinking, if possible.. perhaps its a listbox with label assigned to it, when they click on the item in the listbox it shows the label else hides?

basically it will just be displaying the text that i want to 'set' or link to a document

Share this post


Link to post
Share on other sites
NateF

This is basically what you are trying to accomplish, right? (with listbox instead of buttons)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Test", 362, 129, 206, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$option1 = GUICtrlCreateRadio("option1", 16, 16, 65, 17)
GUICtrlSetOnEvent(-1, "option1Click")
$option2 = GUICtrlCreateRadio("option2", 16, 40, 65, 17)
GUICtrlSetOnEvent(-1, "option2Click")
$option3 = GUICtrlCreateRadio("option3", 16, 64, 65, 17)
GUICtrlSetOnEvent(-1, "option3Click")
$option4 = GUICtrlCreateRadio("option4", 16, 88, 65, 17)
GUICtrlSetOnEvent(-1, "option4Click")
$editbox = GUICtrlCreateEdit("", 88, 8, 265, 113)
GUICtrlSetData(-1, "editbox")
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "editboxChange")
GUISetState(@SW_SHOW)
Global $selected = ""


While 1
    Sleep(100)
    GUICtrlSetData($editbox, $selected)
WEnd


Func Form1Close()
exit
EndFunc


Func option1Click()
Global $selected = "Option 1 has been selected.."
EndFunc

Func option2Click()
Global $selected = "Option 2 has been selected.."
EndFunc

Func option3Click()
Global $selected = "Option 3 has been selected.."
EndFunc

Func option4Click()
Global $selected = "Option 4 has been selected.."
EndFunc
Edited by NateF

Share this post


Link to post
Share on other sites
13lack13lade

NateF ^ Exactly what im trying to do...!!!!!! <3

except have it built into my GUI so it isnt its own window just their own objects, if this is the easiest way to do that, i will totally steal this script..

Also in regards to the output - is it able to display images at all aswell as text or strictly text only? and does it need to be hardcoded in, or can it be linked to a word doc?

Edited by 13lack13lade

Share this post


Link to post
Share on other sites
NateF

 

NateF ^ Exactly what im trying to do...!!!!!! <3

except have it built into my GUI so it isnt its own window just their own objects, if this is the easiest way to do that, i will totally steal this script..

 

Cheers.  If I had the first piece of your script, I might be able to integrade it for you

 

Also in regards to the output - is it able to display images at all aswell as text or strictly text only? and does it need to be hardcoded in, or can it be linked to a word doc?

 

I've been trying the transparent edit box approach but am not having very much success..

Also, FileRead should be able to accomplish this.

Share this post


Link to post
Share on other sites
13lack13lade

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>


#Region ### START Koda GUI section ### Form=
$DataloadScreen = GUICreate("FCGP Dashboard", 1178, 757, 256, 99)
$Banner = GUICtrlCreatePic("Q:\Documents\Load Support\Tom\Projects\Dashboard\Images\banner.jpg", 0, 0, 1177, 137, BitOR($GUI_SS_DEFAULT_PIC,$WS_BORDER))
$Trackingbtn = GUICtrlCreateButton("Tracking", 8, 296, 169, 49)
$Loadbtn = GUICtrlCreateButton("Load Guide", 8, 368, 169, 49)
$Quicklinksbtn = GUICtrlCreateButton("QuickLinks", 8, 440, 169, 49)
$Dataloadbtn = GUICtrlCreateButton("Dataload", 8, 512, 169, 49)
$Formsbtn = GUICtrlCreateButton("Forms", 8, 584, 169, 49)
$Logo = GUICtrlCreatePic("C:\Users\webbth\Pictures\Untitled1.jpg", 8, 152, 169, 121, BitOR($GUI_SS_DEFAULT_PIC,$WS_BORDER))
$Feedbackbtn = GUICtrlCreateButton("Dashboard Feedback", 8, 656, 169, 49)
$MainLogo = GUICtrlCreateLabel("FCGP Dashboard", 400, 40, 420, 79)
GUICtrlSetFont(-1, 48, 400, 0, "Arial Narrow")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(Default, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    
    EndSwitch
WEnd

Here is the script which is what i use for a template.

Im not sure what the best object is to display it as you say, possibly edit box - FileRead hmmmm and just change the button to FileRead(Document), like your thinking! (never used fileread surprisingly)

Edited by 13lack13lade

Share this post


Link to post
Share on other sites
NateF

Here is the script which is what i use for a template.

 

I had to squish it a bit just to get it on my laptop screen..

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$DataloadScreen = GUICreate("FCGP Dashboard", 1178, 610, 143, 90)
GUISetOnEvent($GUI_EVENT_CLOSE, "DataloadScreenClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "DataloadScreenMinimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "DataloadScreenMaximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "DataloadScreenRestore")
$Banner = GUICtrlCreatePic("Q:\Documents\Load Support\Tom\Projects\Dashboard\Images\banner.jpg", 0, 0, 1177, 137, BitOR($GUI_SS_DEFAULT_PIC,$WS_BORDER))
GUICtrlSetOnEvent(-1, "BannerClick")
$Trackingbtn = GUICtrlCreateButton("Tracking", 8, 272, 169, 49)
GUICtrlSetOnEvent(-1, "TrackingbtnClick")
$Loadbtn = GUICtrlCreateButton("Load Guide", 8, 328, 169, 49)
GUICtrlSetOnEvent(-1, "LoadbtnClick")
$Quicklinksbtn = GUICtrlCreateButton("QuickLinks", 8, 384, 169, 49)
GUICtrlSetOnEvent(-1, "QuicklinksbtnClick")
$Dataloadbtn = GUICtrlCreateButton("Dataload", 8, 440, 169, 49)
GUICtrlSetOnEvent(-1, "DataloadbtnClick")
$Formsbtn = GUICtrlCreateButton("Forms", 8, 496, 169, 49)
GUICtrlSetOnEvent(-1, "FormsbtnClick")
$Logo = GUICtrlCreatePic("C:\Users\webbth\Pictures\Untitled1.jpg", 8, 144, 169, 121, BitOR($GUI_SS_DEFAULT_PIC,$WS_BORDER))
GUICtrlSetOnEvent(-1, "LogoClick")
$Feedbackbtn = GUICtrlCreateButton("Dashboard Feedback", 8, 552, 169, 49)
GUICtrlSetOnEvent(-1, "FeedbackbtnClick")
$MainLogo = GUICtrlCreateLabel("FCGP Dashboard", 400, 40, 420, 79)
GUICtrlSetFont(-1, 48, 400, 0, "Arial Narrow")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "MainLogoClick")
$Group1 = GUICtrlCreateGroup("", 184, 144, 985, 457)
$selected = ""
$editbox = GUICtrlCreateEdit("", 192, 160, 969, 433)
GUICtrlSetData(-1, $selected)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "editboxChange")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    Sleep(100)
WEnd


Func DataloadbtnClick()
   Global $selected = "Data load button has been pressed."
   GUICtrlSetData($editbox, $selected)
   GUICtrlSetState($editbox, $GUI_DISABLE)
EndFunc

Func DataloadScreenClose()
exit
EndFunc

Func editboxChange()
EndFunc

Func FeedbackbtnClick()
   Global $selected = "Feedback button has been pressed."
   GUICtrlSetData($editbox, $selected)
   GUICtrlSetState($editbox, $GUI_DISABLE)
EndFunc

Func FormsbtnClick()
   Global $selected = "Forms button has been pressed."
   GUICtrlSetData($editbox, $selected)
   GUICtrlSetState($editbox, $GUI_DISABLE)
EndFunc

Func LoadbtnClick()
   Global $selected = "Load button has been pressed."
   GUICtrlSetData($editbox, $selected)
   GUICtrlSetState($editbox, $GUI_DISABLE)
EndFunc

Func QuicklinksbtnClick()
   Global $selected = "Quick-links button has been pressed."
   GUICtrlSetState($editbox, $GUI_ENABLE)
   GUICtrlSetData($editbox, $selected)
EndFunc
Func TrackingbtnClick()
   Global $selected = "Tracking button has been pressed."
   GUICtrlSetData($editbox, $selected)
   GUICtrlSetState($editbox, $GUI_DISABLE)
EndFunc
Edited by NateF

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×