Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

run in administrator mode vb6

Posted on 2014-11-11
3
Medium Priority
?
158 Views
Last Modified: 2014-11-19
I am trying to extrapolate data from a file using some vb6 code.  I need to be in Administrator mode when opening certain files and running this code in vb6

Private Sub Command1_Click()
Dim objMSWord As Word.Application
Dim myDoc As Word.Document
Set objMSWord = CreateObject("Word.Application")
Set myDoc = objMSWord.Documents.Open("C:\111114.txt")

For Each p In myDoc.Paragraphs
  If InStr(p.Range.Text, "BlockedIP") > 0 Then
   'Skipping - found text
  Else
    p.Range.Delete
  End If
Next

myDoc.SaveAs ("c:\Users\Me\Desktop\052214_2.txt")
myDoc.Close
Set myDoc = Nothing
objMSWord.Quit
End Sub

Open in new window


Is there a way to run this code in administrator mode?
0
Comment
Question by:al4629740
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
brendanmeyer earned 1000 total points
ID: 40436676
you wil have to run the exe in administrator mode
0
 

Author Comment

by:al4629740
ID: 40436681
Is there a way for the program to prompt the exe to run in administrator mode?
0
 

Author Closing Comment

by:al4629740
ID: 40454182
Unresolved answer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

662 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question