Open text file once created (1 Viewer)

J_oggy07

New member
Local time
Today, 22:53
Joined
Apr 18, 2023
Messages
14
Hi,
This is working fine, but I wish file to open so we can copy and paste prices.
Thanks for all your help.
John.


Private Sub Command180_Click()

Dim FSO As New FileSystemObject
Dim myarray1 As String
Dim myarray2 As String

Set FSO = CreateObject("Scripting.FileSystemObject")
Set filetocreate = FSO.CreateTextFile("C:\Users\jhodgson\Desktop\QTY_Breaks.txt")

myarray1 = "Price for 1 off : " & Format(Forms!PricingForm!priceQTY1, "##,##0.00") & " " & Forms!PricingForm!Custcurrency&
myarray2 = "Price for 2 off : " & Format(Forms!PricingForm!PriceQTY2, "##,##0.00") & " " & Forms!PricingForm!Custcurrency&

filetocreate.WriteLine " QTY Breaks"
filetocreate.WriteLine " "
filetocreate.WriteLine myarray1
filetocreate.WriteLine myarray2


filetocreate.Close


End Sub
 

J_oggy07

New member
Local time
Today, 22:53
Joined
Apr 18, 2023
Messages
14
notepad
 

cheekybuddha

AWF VIP
Local time
Today, 22:53
Joined
Jul 21, 2014
Messages
2,280
If the Application.FollowHyperlink method pops up security dialogs you can also use:
Code:
' your code ...

Call Shell(Environ("windir") & "\system32\notepad.exe ""C:\Users\jhodgson\Desktop\QTY_Breaks.txt""" )
 

J_oggy07

New member
Local time
Today, 22:53
Joined
Apr 18, 2023
Messages
14
If the Application.FollowHyperlink method pops up security dialogs you can also use:
Code:
' your code ...

Call Shell(Environ("windir") & "\system32\notepad.exe ""C:\Users\jhodgson\Desktop\QTY_Breaks.txt""" )
Thanks, works a treat
 

Users who are viewing this thread

Top Bottom