|
-
Jan 11th, 2010, 03:02 AM
#1
Thread Starter
New Member
Command to insert location once
Hey,
At work we are "programming" some reports (in know its very basic). We use 1word-file (thats empty) and dépending of the result we insert a different kind of file (negatif, positive etc).
Now everytime i use Inerstfile,..., G:\...\Name of the file
I used that command for more then 50 times (cause there are many different reports)...
So the day that i change the reports of plave i have to change at least 50 lines.
So thats why I wanted to know if their exists a code that i can use, in the beginning of my script, so when i change the location of my reports i just have to change that line once and not at every insertfile that i use.
I hope somebody can help 
Greetz
-
Jan 11th, 2010, 06:22 AM
#2
Re: Command to insert location once
I'm not sure what you are referring to! Do you mean and easier way to insert the report name into the report?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 11th, 2010, 08:18 AM
#3
Thread Starter
New Member
Re: Command to insert location once
This i a small part.
...
Case "Cases"
Select Case NAT
Case "Result"
Selection.InsertFile FileName:= _
"G:\test\test\test\For us\filename.dot", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False (1)
End Select
...
Depending de cases and the results we enter a different kind of file. You have to know that at work we have a big network where we have just a small part for us. We can't choose the directory etc. That means that when its operational and other departments gone use our file they gone have to change at least 40 times the section
G:\test\test\test\...\ Filename.dot
Now i was curious if its possible to enter something thats replaces G:\test\test\test\... by a word and that somewhere else that word is defined with G:\test\test\test\....
So that we just have to change one line instead of every entry (1).
-
Jan 11th, 2010, 09:08 AM
#4
Re: Command to insert location once
that would be called a variable or constant. is this VB, or VBScript, or..?
you should be able to do something like:
vb Code:
Const Path = "G:\path\to\folder\" 'or Dim Path as String Path = "G:\path\to\folder" '... Selection.InsertFile Filename:= Path & "\filename.ext", Range:="", ...
syntax may differ slightly depending on the language!
-
Jan 12th, 2010, 03:25 AM
#5
Thread Starter
New Member
Re: Command to insert location once
Thank you for the quick respons. 
It praticcaly saves my day
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
|