-
March 15th, 2004, 02:46 PM
#1
Change Notepad settings from VB 6.0
I have started Notepad with the Shell function.
Is there a way to change the Page Orientation, Header & Footer
Information, and the Font from within the VB program?
Or:
Can you create an instance of or object of Notepad as you can
with MS Word? How about Wordpad?
Greatful for any advice!
Thanks
-
March 16th, 2004, 07:53 AM
#2
Notepad or Wordpad are not com compliant
Thus you cannot instantiate them.
But you should achieve your goal reading andd changing some registry keys.
Modifying Notepad:
http://www.codeguru.com/forum/showth...hlight=notepad
Using WordPad:
http://www.codeguru.com/forum/showth...hlight=notepad
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
March 16th, 2004, 06:13 PM
#3
Thanks Cimperiali,
The Registry is the way to resolve my problems, now if I could just get it to work.
I have written this in my program:
SaveSetting "HKEY_CURRENT_USER\Software\Microsoft", "Notepad", "lfFaceName", "Arial Black"
varSetting = GetSetting("HKEY_CURRENT_USER\Software\Microsoft", "Notepad", "lfFaceName")
Debug.Print varSetting
Debug-Print shows that I have saved the value for lfFaceName as Arial Black, but RegEdit still shows the Notepad lfFaceName as Courier New so Notepad still comes up with Courier New.
Where did the change get saved?
From my program, how can I:
1.) Change the Page Orientation from Portrait to Landscape?
2.) Remove the values stored in Page Header and Footer?
3.) Change the Top and Left margins?
Again, Thanks for getting me on the right track with the Registry,
if you could help me resolve these problems I would greatly appreciate it, or point me to a resource which will guide me through this.
Richard
-
March 17th, 2004, 05:23 AM
#4
savesettings...
Savesettings is not the way to write where you need, as it adds keys and value under....\vba....
take a look here
..... Links removed .... Domain redirects ....
Last edited by GremlinSA; January 10th, 2013 at 01:45 AM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
January 9th, 2013, 01:12 PM
#5
Re: savesettings...
Originally Posted by Cimperiali
Savesettings is not the way to write where you need, as it adds keys and value under....\vba....
take a look here
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Just as an FYI, this web site takes you to a PORN SITE.
Last edited by GremlinSA; January 10th, 2013 at 01:46 AM.
-
January 10th, 2013, 01:46 AM
#6
Re: savesettings...
Originally Posted by Twindad97
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Just as an FYI, this web site takes you to a PORN SITE.
Thanks...
Taken care of the links...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
January 11th, 2013, 07:30 AM
#7
Re: Change Notepad settings from VB 6.0
You'd need to use the RegSaveKey to save keys like these. Have a look here :
http://allapi.mentalis.org/apilist/RegSaveKey.shtml
Remember also changing system wide settings are usually frowned upon...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|