Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

How should these items be declared?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Maxey - 03 Nov 2005 01:41 GMT
What should fLog and moog be declared as in the snippet of code below?

Dim fFolderName As String, filename As String, oFolderPath As String
Dim f As Object
Dim flog
Dim moog

Set f = CreateObject("Scripting.FileSystemObject")
fFolderName = Environ$("APPDATA") & "\~folders" & ".txt"
mFileName = Environ$("APPDATA") & "\~macros" & ".txt"
Set fLog = f.Createtextfile(fFolderName, True)
Set mLog = f.Createtextfile(mFileName, True)

Thanks

Signature

Greg Maxey

Greg Maxey - 03 Nov 2005 02:20 GMT
Don't know how moog appeard below.  It should read mLog.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> What should fLog and moog be declared as in the snippet of code below?
>
[quoted text clipped - 10 lines]
>
> Thanks
Tony Jollans - 03 Nov 2005 11:24 GMT
moog was obviously synthesised!

To find out types for objects from non-referenced libraries you can pause
the code after the object pointers have been set and, in the immediate
window enter, for example,

?Typename(mlog)

or you can add the same thing temporarily in your code - either

Msgbox typename(mlog)

or

debug.print typename(mlog)

--
Enjoy,
Tony

> Don't know how moog appeard below.  It should read mLog.
>
[quoted text clipped - 18 lines]
> >
> > Thanks
Greg Maxey - 03 Nov 2005 12:12 GMT
Thanks Tony.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> moog was obviously synthesised!
>
[quoted text clipped - 35 lines]
>>>
>>> Thanks
Jean-Guy Marcil - 03 Nov 2005 16:08 GMT
Tony Jollans was telling us:
Tony Jollans nous racontait que :

> moog was obviously synthesised!
>
> To find out types for objects from non-referenced libraries you can
> pause the code after the object pointers have been set and, in the
> immediate window enter, for example,

But keep in mind that if it is non-referenced, then Declaring it as its
actual type will cause an error.
In other words, if you plan on declaring a variable as its actual type, then
you have to reference it, otherwise, just declare it as "Object".

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 

Jean-Guy Marcil - 03 Nov 2005 04:00 GMT
Greg Maxey was telling us:
Greg Maxey nous racontait que :

> What should fLog and moog be declared as in the snippet of code below?
>
[quoted text clipped - 10 lines]
>
> Thanks

Dim fLog As TextStream
Dim mLog As TextStream

In the Object Browser (F2), select "Scripting" in the list of libraries.
Then find "FileSystemObject" in the classes and finally click on
"CreateTextFile" in the Members section in the right-hand side pane. At the
bottom, you should see something like:
   Function CreateTextFile(FileName As String, [Overwrite As Boolean =
True], [Unicode As Boolean = False]) As TextStream
   Member of Scripting.FileSystemObject
   Create a file as a TextStream

HTH

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 

Greg Maxey - 03 Nov 2005 04:15 GMT
Thanks.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Greg Maxey was telling us:
> Greg Maxey nous racontait que :
[quoted text clipped - 27 lines]
>
> HTH
Greg Maxey - 03 Nov 2005 04:21 GMT
JGM,

I don't have a "scripting" in the list of libaries :-(

Where do I find it?

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Greg Maxey was telling us:
> Greg Maxey nous racontait que :
[quoted text clipped - 27 lines]
>
> HTH
Jonathan West - 03 Nov 2005 11:32 GMT
It's called Microsoft Scripting Runtime in the Tools References list.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> JGM,
>
[quoted text clipped - 33 lines]
>>
>> HTH
Greg Maxey - 03 Nov 2005 12:12 GMT
Ok, thanks.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> It's called Microsoft Scripting Runtime in the Tools References list.
>
[quoted text clipped - 41 lines]
>>>
>>> HTH

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.